-
Notifications
You must be signed in to change notification settings - Fork 137
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
Conversation
Added output error messsages to the tmux plugin file so that if either cmake or make fail, you can find out why. For example, if cmake is missing, the output looks like this: ``` 'cmake /usr/local/google/home/nhdaly/.tmux/plugins/tmux-mem-cpu-load' failed. /usr/local/google/home/nhdaly/.tmux/plugins//tmux-mem-cpu-load/tmux-mem-cpu-load.plugin.tmux: line 23: cmake: command not found ``` If there is some error during make, the output looks like this: ``` tmux-mem-cpu-load failed to build. make: <make output error message> ```
01a8f0f
to
5c37494
Compare
# 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 |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
cool! :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for the improvement!
# 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 |
There was a problem hiding this comment.
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.
Thanks for the quick review again! :) |
Added error message printing to the tmux plugin.
Added output error messsages to the tmux plugin file so that if either
cmake or make fail, you can find out why.
For example, if cmake is missing, the output looks like this:
If there is some error during make, the output looks like this:
This exact issue came up because my friend didn't have cmake installed, but the current
.plugin.tmux
file fails silently.