Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added error message printing to the tmux plugin. #47

Merged
merged 1 commit into from
Sep 28, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 10 additions & 2 deletions tmux-mem-cpu-load.plugin.tmux
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,14 @@
CURRENT_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

pushd $CURRENT_DIR #Pushd to the directory where this plugin is located.
cmake .
make

# Attempt to rebuild the plugin and log any errors in the tmux display window.
output=$(cmake . 2>&1) || tmux run-shell "echo \"'cmake $CURRENT_DIR' failed.
$output
\"" && exit 1
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It might make more sense not to exit here, if it's possible that cmake can exit with a non-zero status but still be able to make the final binary?

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If cmake fails, then the Makefile will not exist or be valid, so this is good.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool! :)


output=$(make 2>&1) || tmux run-shell "echo \"tmux-mem-cpu-load failed to build.
$output
\"" && exit 1

popd