From 9db92163d5fa370f9e53c0b4bb462c5169c64035 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Wed, 6 Sep 2017 21:35:08 -0400 Subject: [PATCH 01/14] Add better help for the plugin-add command. --- help.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/help.txt b/help.txt index c02ab7a9..45037f34 100644 --- a/help.txt +++ b/help.txt @@ -1,5 +1,6 @@ MANAGE PLUGINS - asdf plugin-add [] Add a plugin + asdf plugin-add [] Add a plugin from the plugin repo OR, add a Git repo + as a plugin by specifying the name and repo url asdf plugin-list List installed plugins asdf plugin-list-all List plugins registered on asdf-plugins repository asdf plugin-remove Remove plugin and package versions From 663ebb9a2fbd80bd9b3b044ee3cbc642b3b24bf4 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Wed, 6 Sep 2017 21:37:08 -0400 Subject: [PATCH 02/14] Move asdf_repository_url function to top of utils.sh. --- lib/utils.sh | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/lib/utils.sh b/lib/utils.sh index 6361401a..e131cc04 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -20,6 +20,10 @@ asdf_dir() { echo $ASDF_DIR } +asdf_repository_url() { + echo "https://github.com/asdf-vm/asdf-plugins.git" +} + get_install_path() { local plugin=$1 local install_type=$2 @@ -257,10 +261,6 @@ get_asdf_config_value() { fi } -asdf_repository_url() { - echo "https://github.com/asdf-vm/asdf-plugins.git" -} - repository_needs_update() { local update_file_dir="$(asdf_dir)/tmp" local update_file_name="repo-updated" From 4da62b16c8e2637aefd541ceedd80b08202e0f06 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Tue, 12 Sep 2017 18:16:49 -0400 Subject: [PATCH 03/14] Move hardcoded version to VERSION file in repo root. --- VERSION | 1 + lib/utils.sh | 6 +----- 2 files changed, 2 insertions(+), 5 deletions(-) create mode 100644 VERSION diff --git a/VERSION b/VERSION new file mode 100644 index 00000000..9e11b32f --- /dev/null +++ b/VERSION @@ -0,0 +1 @@ +0.3.1 diff --git a/lib/utils.sh b/lib/utils.sh index e131cc04..3bb5a4b7 100644 --- a/lib/utils.sh +++ b/lib/utils.sh @@ -4,11 +4,7 @@ GREP_OPTIONS="--color=never" GREP_COLORS= asdf_version() { - # Move to the asdf repo, then report the current tag - ( - cd $(asdf_dir) - git describe --tags - ) + cat "$(asdf_dir)/VERSION" } asdf_dir() { From 5b35ea01db6a3c180a78b42ad6682249c039be4b Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Tue, 12 Sep 2017 18:21:04 -0400 Subject: [PATCH 04/14] Add code to release.sh to update the version hardcoded in the VERSION file. --- release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release.sh b/release.sh index 8f40ef52..5be6fb6a 100755 --- a/release.sh +++ b/release.sh @@ -67,8 +67,8 @@ fi # Update version in README sed -i.bak "s|^\(git clone.*--branch \).*$|\1$new_tag_name|" README.md -# Update version in utils.sh -# TODO: Hardcode version until.sh since not all asdf will include the Git repo +# Update version in utils.she +echo "$new_tag_name" > VERSION echo "INFO: Committing and tagging new version" From 252ee6a6082a3fcbe949a11d160a1f021b195510 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Tue, 12 Sep 2017 18:22:26 -0400 Subject: [PATCH 05/14] Add more items to CHANGELOG.md. --- CHANGELOG.md | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index af107258..6a90cb6b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,17 +1,21 @@ # Changelog -## 0.3.1-dev +## 0.3.2-dev + +## 0.3.1 Features -* Add CONTRIBUTING guidelines and GitHub issue and pull request templates +* Add CONTRIBUTING guidelines and GitHub issue and pull request templates (#217) * Add `plugin-list-all` command to list plugins from asdf-plugins repo. (#221) * `asdf current` shows all current tool versions when given no args (#219) * Add asdf-plugin-version metadata to shims (#212) +* Add release.sh script to automate release of new versions (#220) Fixed Bugs * Allow spaces on path containing the `.tool-versions` file (#224) +* Fixed bug in `--version` functionality so it works regardless of how asdf was installed (#198) ## 0.3.0 From 84ad80f5752908707899301220a9779e15925a85 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Tue, 12 Sep 2017 18:33:48 -0400 Subject: [PATCH 06/14] Add mechanism to disable the update command since it will not work when asdf is installed via brew. --- lib/commands/update.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/lib/commands/update.sh b/lib/commands/update.sh index fae019de..370a3d1a 100644 --- a/lib/commands/update.sh +++ b/lib/commands/update.sh @@ -4,6 +4,17 @@ update_command() { ( cd $(asdf_dir) + if [ -f asdf_updates_disabled ]; then + echo "Update command disabled. Please use the package manager that you used to install asdf to upgrade asdf." + else + do_update "$update_to_head" + fi + ) +} + +do_update() { + local update_to_head=$1 + if [ "$update_to_head" = "--head" ]; then # Update to latest on the master branch git checkout master @@ -20,7 +31,6 @@ update_command() { git checkout "$tag" || exit 1 echo "Updated asdf to release $tag" fi - ) } # stolen from https://github.com/rbenv/ruby-build/pull/631/files#diff-fdcfb8a18714b33b07529b7d02b54f1dR942 From 6c90970e1789af0c3b3ddb46d7d88e4c9caecbb9 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Tue, 12 Sep 2017 18:40:31 -0400 Subject: [PATCH 07/14] Add help message that explains how to revert a bad release tagging to the release.sh script. --- release.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/release.sh b/release.sh index 5be6fb6a..47628d61 100755 --- a/release.sh +++ b/release.sh @@ -18,6 +18,23 @@ This script updates the hardcoded versions in the source code and README and then commits them on the current branch. It then tags that commit with the specified version. +If you run this script in error, or with the wrong version, you can undo the +changes by finding the original state in the list of actions listed in the +reflog: + + git reflog + +Then revert to the original state by running `git checkout` with the reference +previous to the release tagging changes: + + git checkout HEAD@{21} + +Then checkout the original branch again: + + git checkout master + +You are back to the original state! + EOF } From 6798101f21a8c2d7b4811b9af15aad62116c02b0 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Tue, 12 Sep 2017 18:42:19 -0400 Subject: [PATCH 08/14] Fix bug in release.sh script. --- release.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/release.sh b/release.sh index 47628d61..e56c347a 100755 --- a/release.sh +++ b/release.sh @@ -84,14 +84,14 @@ fi # Update version in README sed -i.bak "s|^\(git clone.*--branch \).*$|\1$new_tag_name|" README.md -# Update version in utils.she +# Update version in the VERSION file echo "$new_tag_name" > VERSION echo "INFO: Committing and tagging new version" # Commit the changed files before tagging the new release git add README.md -git add lib/utils.sh +git add VERSION git commit -m "Update version to $new_version" git tag -a "$new_tag_name" -m "Version ${new_version}" From 19f3bcd488493be6bb67bfe8f8f233b3eaf2ed79 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Sun, 17 Sep 2017 16:27:21 -0400 Subject: [PATCH 09/14] Change version to 0.4.0. --- VERSION | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/VERSION b/VERSION index 9e11b32f..1d0ba9ea 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.3.1 +0.4.0 From d19f6131a6745517070a895e89b9caf2fd912e88 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Tue, 19 Sep 2017 17:44:34 -0400 Subject: [PATCH 10/14] Update version to 0.4.0 --- README.md | 2 +- VERSION | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 99b4d13a..1215d3fb 100644 --- a/README.md +++ b/README.md @@ -8,7 +8,7 @@ Supported languages include Ruby, Node.js, Elixir and [more](https://github.com/ Copy-paste the following into command line: ```bash -git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.3.0 +git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.4.0 ``` Depending on your OS, run the following diff --git a/VERSION b/VERSION index 1d0ba9ea..fb7a04cf 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -0.4.0 +v0.4.0 From 896bd163e07e1b9b8d6868e364b3c8cd9e9ab519 Mon Sep 17 00:00:00 2001 From: Trevor Brown Date: Tue, 19 Sep 2017 18:02:07 -0400 Subject: [PATCH 11/14] Correct versions in CHANGELOG.md. --- CHANGELOG.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 6a90cb6b..d7ebc525 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,8 +1,8 @@ # Changelog -## 0.3.2-dev +## 0.4.1-dev -## 0.3.1 +## 0.4.0 Features From 6a63299decf710d9ab232c11d84350458853b507 Mon Sep 17 00:00:00 2001 From: Daniel Perez Date: Wed, 27 Sep 2017 16:40:50 +0900 Subject: [PATCH 12/14] Update fish completions --- completions/asdf.fish | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/completions/asdf.fish b/completions/asdf.fish index 31fc4254..56b8afbc 100644 --- a/completions/asdf.fish +++ b/completions/asdf.fish @@ -26,17 +26,16 @@ function __fish_asdf_arg_at -a number echo $cmd[$number] end -set -l official_plugins ruby erlang nodejs elixir - - # plugin-add completion complete -f -c asdf -n '__fish_asdf_needs_command' -a plugin-add -d "Add git repo as plugin" -complete -f -c asdf -n '__fish_asdf_using_command plugin-add; and __fish_asdf_arg_number 2' -a (echo $official_plugins) -complete -f -c asdf -n '__fish_asdf_using_command plugin-add; and __fish_asdf_arg_number 3' -a '(echo https://github.com/asdf-vm/asdf-(__fish_asdf_arg_at 3).git)' +complete -f -c asdf -n '__fish_asdf_using_command plugin-add; and __fish_asdf_arg_number 2' -a '(asdf plugin-list-all)' # plugin-list completion complete -f -c asdf -n '__fish_asdf_needs_command' -a plugin-list -d "List installed plugins" +# plugin-list-all completion +complete -f -c asdf -n '__fish_asdf_needs_command' -a plugin-list-all -d "List all existing plugins" + # plugin-remove completion complete -f -c asdf -n '__fish_asdf_needs_command' -a plugin-remove -d "Remove plugin and package versions" complete -f -c asdf -n '__fish_asdf_using_command plugin-remove; and __fish_asdf_arg_number 2' -a '(asdf plugin-list)' From 56b84569207aa63568e716c5adb10a3aaf5026a0 Mon Sep 17 00:00:00 2001 From: Daniel Perez Date: Wed, 27 Sep 2017 16:41:49 +0900 Subject: [PATCH 13/14] Fix tab formatting in fish completions --- completions/asdf.fish | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/completions/asdf.fish b/completions/asdf.fish index 56b8afbc..b077dee7 100644 --- a/completions/asdf.fish +++ b/completions/asdf.fish @@ -18,12 +18,12 @@ end function __fish_asdf_arg_number -a number set -l cmd (commandline -opc) - test (count $cmd) -eq $number + test (count $cmd) -eq $number end function __fish_asdf_arg_at -a number set -l cmd (commandline -opc) - echo $cmd[$number] + echo $cmd[$number] end # plugin-add completion From 959033bdd217f99f3d9592df3cc6fea5983ecd5d Mon Sep 17 00:00:00 2001 From: Ivan Mironov Date: Thu, 28 Sep 2017 14:32:37 +0300 Subject: [PATCH 14/14] Fix creating-plugins link --- CONTRIBUTING.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5d9a3b14..de091e20 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -26,12 +26,12 @@ Travis CI. ## Did you create a plugin for asdf? -Please read the [creating plugins](doc/creating-plugins.md) guide. +Please read the [creating plugins](docs/creating-plugins.md) guide. ## Do you want to contribute the asdf documentation? Documentation can always be improved! Right now there is just the -[README](README.md) and the [creating plugins](doc/creating-plugins.md) guide. +[README](README.md) and the [creating plugins](docs/creating-plugins.md) guide. The [wiki](https://github.com/asdf-vm/asdf/wiki) exists but is in a state of disrepair. If you see something that can be improved please submit a pull request or edit the wiki.