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

feat(golang-rewrite): add 0.16.0 migration notice to old Bash code #1833

Merged
merged 1 commit into from
Jan 30, 2025
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
21 changes: 21 additions & 0 deletions bin/asdf
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,7 @@ asdf_cmd() {

exec "$ASDF_CMD_FILE" "${@:${args_offset}}"
elif [ -f "$ASDF_CMD_FILE" ]; then
print_0_16_0_migration_notice
set -- "${@:${args_offset}}"
# shellcheck source=/dev/null
. "$ASDF_CMD_FILE"
Expand All @@ -122,4 +123,24 @@ asdf_cmd() {
fi
}

print_0_16_0_migration_notice() {
printf -- '\033[1;31m----------

NOTICE:

You have tried to upgrade to asdf 0.16.0 or newer. Versions 0.16.0 is a
complete rewrite of asdf in Go. This text is being printed by the older
Bash implementation. If you are seeing this you have not migrated to
asdf 0.16.0. Please follow the instructions on the upgrade guide to
migrate to the new version.

Aside from this notice, this older Bash implementation works as it did
in asdf version 0.15.0 and older.

Migration guide: https://asdf-vm.com/guide/upgrading-to-v0-16
asdf website: https://asdf-vm.com
Source code: https://github.com/asdf-vm/asdf
\033[0m\n\n' >&2
}

asdf_cmd "$@"