tinted-theming / tinted-shell

Base16 and Base24 for Shells
https://github.com/tinted-theming/home
MIT License
61 stars 218 forks source link

Switch return to exit to prevent shell errors #11

Closed joshbode closed 2 years ago

joshbode commented 2 years ago

fixes issue with return appearing outside of function:

Cannot source /home/josh/.config/zsh/.zcomet/repos/base16-project/base16-shell/base16-shell.plugin.zsh.
❱ $BASE16_SHELL_PATH/profile_helper.sh
/home/josh/.config/zsh/.zcomet/repos/base16-project/base16-shell/profile_helper.sh: line 95: return: can only `return' from a function or sourced script
JamyGolden commented 2 years ago

Thanks for the PR. Which shell and OS are you using?

joshbode commented 2 years ago

Awesome - thank you @JamyGolden :)

JamyGolden commented 2 years ago

@joshbode I'm having issues with this on ZSH (5.8.1) in Linux, I need to go to sleep now so I'm going to revert. I'll look into it tomorrow, but it looks like the aliases base16_* aren't set if profile_helper.sh is executed and not sourced.

joshbode commented 2 years ago

ah - right - yes, the variables wouldn't be exporting - sorry about that :) I'll work on this some more in a new PR, and restore the source behaviour and find a way to preserve the guards without exit which won't work for sourcing

JamyGolden commented 2 years ago

@joshbode thanks! I would usually have tested the PR locally but it was late for me and it looked good, so no problem for it not working.