Skip to content

Commit

Permalink
fix!: Remove files containing only asdf wrapper functions (#1525)
Browse files Browse the repository at this point in the history
  • Loading branch information
hyperupcall authored Apr 1, 2023
1 parent 8919f40 commit 00fee78
Show file tree
Hide file tree
Showing 6 changed files with 32 additions and 44 deletions.
16 changes: 14 additions & 2 deletions asdf.fish
Original file line number Diff line number Diff line change
Expand Up @@ -20,5 +20,17 @@ if not contains $_asdf_shims $fish_user_paths
end
set --erase _asdf_bin _asdf_shims

# Load the asdf wrapper function
. $ASDF_DIR/lib/asdf.fish
# The asdf function is a wrapper so we can export variables
function asdf
set command $argv[1]
set -e argv[1]

switch "$command"
case shell
# Source commands that need to export variables.
command asdf export-shell-version fish $argv | source # asdf_allow: source
case '*'
# Forward other commands to asdf script.
command asdf "$command" $argv
end
end
19 changes: 17 additions & 2 deletions asdf.sh
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,21 @@ esac

unset -v _asdf_bin _asdf_shims

# shellcheck source=lib/asdf.sh
. "$ASDF_DIR/lib/asdf.sh"
# The asdf function is a wrapper so we can export variables
asdf() {
case $1 in
"shell")
if ! shift; then
printf '%s\n' 'asdf: Error: Failed to shift' >&2
return 1
fi

# Invoke command that needs to export variables.
eval "$(asdf export-shell-version sh "$@")" # asdf_allow: eval
;;
*)
# Forward other commands to asdf script.
command asdf "$@" # asdf_allow: ' asdf '
;;
esac
}
14 changes: 0 additions & 14 deletions lib/asdf.fish

This file was deleted.

20 changes: 0 additions & 20 deletions lib/asdf.sh

This file was deleted.

3 changes: 1 addition & 2 deletions scripts/shellcheck.bash
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,7 @@ set -euo pipefail

# check .sh files
shellcheck --shell sh --external-sources \
asdf.sh \
lib/*.sh
asdf.sh

# check .bash files
shellcheck --shell bash --external-sources \
Expand Down
4 changes: 0 additions & 4 deletions scripts/shfmt.bash
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,6 @@

set -euo pipefail

# check .sh files
shfmt --language-dialect posix --indent 2 --diff \
lib/*.sh

# check .bash files
shfmt --language-dialect bash --indent 2 --diff \
completions/*.bash \
Expand Down

0 comments on commit 00fee78

Please sign in to comment.