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

Conversation

NHDaly
Copy link
Contributor

@NHDaly NHDaly commented Sep 27, 2016

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>

This exact issue came up because my friend didn't have cmake installed, but the current .plugin.tmux file fails silently.

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>
```
@NHDaly NHDaly force-pushed the tmux-error-messages branch from 01a8f0f to 5c37494 Compare September 27, 2016 23:24
# 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! :)

Copy link
Owner

@thewtex thewtex left a 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
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.

@thewtex thewtex merged commit 0e227c1 into thewtex:master Sep 28, 2016
@NHDaly
Copy link
Contributor Author

NHDaly commented Sep 28, 2016

Thanks for the quick review again! :)

@NHDaly NHDaly deleted the tmux-error-messages branch September 28, 2016 05:39
dev-hann added a commit to dev-hann/tmux-mem-cpu-load that referenced this pull request Sep 18, 2023
Added error message printing to the tmux plugin.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants