-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Allows users to declare custom aliases
- Loading branch information
Showing
3 changed files
with
26 additions
and
7 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -319,7 +319,11 @@ declare _GO_INJECT_MODULE_PATH="$_GO_INJECT_MODULE_PATH" | |
esac | ||
|
||
if [email protected]_builtin 'aliases' --exists "$cmd"; then | ||
eval "$cmd" "$@" | ||
if [[ " ${GO_ALIAS_EXPAND_CMDS[*]} " == *" $cmd "* ]]; then | ||
eval "$cmd" "$@" | ||
else | ||
"$cmd" "$@" | ||
fi | ||
return | ||
fi | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,6 +28,10 @@ if [[ "${GO_ALIAS_CMDS_EXTRA[*]}" != '' ]]; then | |
_GO_ALIAS_CMDS+=( "${GO_ALIAS_CMDS_EXTRA[@]}" ) | ||
fi | ||
|
||
if [[ "${GO_ALIAS_EXPAND_CMDS[*]}" != '' ]]; then | ||
_GO_ALIAS_CMDS+=( "${GO_ALIAS_EXPAND_CMDS[@]}" ) | ||
fi | ||
|
||
readonly _GO_ALIAS_CMDS | ||
|
||
[email protected]() { | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters