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

Adding support to zsh to the export.sh script #2340

Merged
merged 1 commit into from
Jun 22, 2021
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
7 changes: 6 additions & 1 deletion Tools/export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,12 @@
#

if [ -z "$SMING_HOME" ]; then
export SMING_HOME=$(readlink -m $BASH_SOURCE/../../Sming)
if [ $(basename $SHELL) = "zsh" ]; then
_SOURCE=${(%):-%N}
Copy link
Contributor

Choose a reason for hiding this comment

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

@charlesschaefer Hello! I'm trying to get this running in MacOS which uses ZSH, wondering if you can shed any light? It's giving me this error:

sming/Tools/export.sh: line 25: ${(%):-%N}: bad substitution

Shell version reported as zsh 5.9 (x86_64-apple-darwin22.0.

Copy link
Contributor

Choose a reason for hiding this comment

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

Actually, might answer my own question! If I source the script there's no error.

else
_SOURCE=$BASH_SOURCE
fi
export SMING_HOME=$(readlink -m $_SOURCE/../../Sming)
fi

# Common
Expand Down