-
Notifications
You must be signed in to change notification settings - Fork 787
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: install script for logging on installation #739
Changes from all commits
270b941
baf85b7
4e37e1e
dd7de05
a646265
e3fa70e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
#!/usr/bin/env bash | ||
|
||
# Unoffical Bash "strict mode" | ||
# http://redsymbol.net/articles/unofficial-bash-strict-mode/ | ||
set -euo pipefail | ||
#ORIGINAL_IFS=$IFS | ||
IFS=$'\t\n' # Stricter IFS settings | ||
|
||
asdf_install_dir=${ASDF_INSTALL_DIR:-"$HOME/.asdf"} | ||
|
||
git clone https://github.com/asdf-vm/asdf.git "${asdf_install_dir}" | ||
# checkout latest tag in repo in another dir | ||
# credit: https://stackoverflow.com/a/6073628/7911479 and https://stackoverflow.com/a/31811385/7911479 | ||
git --git-dir "${asdf_install_dir}/.git" --work-tree "${asdf_install_dir}" checkout "$(git describe --abbrev=0 --tags)" --quiet | ||
|
||
printf "\n%s\n" "asdf setup" | ||
printf "%s\t\t\t%s\n" "1: install asdf" "completed!" | ||
printf "%s\t%s\n" "2: add asdf to your shell" "https://asdf-vm.com/#/core-manage-asdf-vm" | ||
printf "%s\t\t\t%s\n" "3: add a plugin" "https://asdf-vm.com/#/core-manage-plugins" | ||
printf "%s\t%s\n" "4: install a tool version" "https://asdf-vm.com/#/core-manage-versions" | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I'm not sure that providing links provides much benefit to the user. Why can't we just tell the user what do to add asdf to their shell? If this script is invoked by the package manager we should be able to tell the user exactly what do to for their specific OS/package manager combination. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
I think that solution is unmaintainable for us. The number of permutations is making the docs difficult to update as is. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
The idea was to capture users who hear about I would like to show these people 2 things:
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Given we don't need to inform users who are installing from the documentation site about the existence of the site, we could leave the docs as is, and only use the install script in Homebrew and co after they clone the repo as they currently do. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we should adopt this pattern. I know it's popular but it has some risks and I don't think we should push our users in this direction.
See:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I agree with all of this. Given it is the install method of choice for Homebrew & OMZSH users I didn't think it was too much an ask, especially since others can still just
git clone
. Additionally, my understanding of prior discussion of package manager code in this repo was that we didn't want to maintain those either.But, we don't necessarily need to use this method for people who are using the docs site - see #739 (comment)