Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #669 from asdf-vm/tb/keep-source
Keep Source
- Loading branch information
Showing
15 changed files
with
253 additions
and
3 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
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
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
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
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
12 changes: 12 additions & 0 deletions
12
test/fixtures/dummy_legacy_plugin/bin/get-version-from-legacy-file
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 |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/usr/bin/env bash | ||
|
||
get_legacy_version() { | ||
current_directory=$1 | ||
version_file="$current_directory/.dummy-version" | ||
|
||
if [ -f "$version_file" ]; then | ||
cat "$version_file" | ||
fi | ||
} | ||
|
||
get_legacy_version "$1" |
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 |
---|---|---|
@@ -0,0 +1,17 @@ | ||
#!/usr/bin/env bash | ||
|
||
mkdir -p "$ASDF_INSTALL_PATH" | ||
env >"$ASDF_INSTALL_PATH/env" | ||
echo "$ASDF_INSTALL_VERSION" >"$ASDF_INSTALL_PATH/version" | ||
|
||
# create the dummy executable | ||
mkdir -p "$ASDF_INSTALL_PATH/bin" | ||
cat <<EOF >"$ASDF_INSTALL_PATH/bin/dummy" | ||
echo This is Dummy ${ASDF_INSTALL_VERSION}! \$2 \$1 | ||
EOF | ||
chmod +x "$ASDF_INSTALL_PATH/bin/dummy" | ||
mkdir -p "$ASDF_INSTALL_PATH/bin/subdir" | ||
cat <<EOF >"$ASDF_INSTALL_PATH/bin/subdir/other_bin" | ||
echo This is Other Bin ${ASDF_INSTALL_VERSION}! \$2 \$1 | ||
EOF | ||
chmod +x "$ASDF_INSTALL_PATH/bin/subdir/other_bin" |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
versions_list=(1.0 1.1 2.0) | ||
echo "${versions_list[@]}" |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
echo ".dummy-version .dummyrc" |
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 |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/usr/bin/env bash | ||
|
||
# shellcheck disable=SC2020 | ||
tr <"$1" -d "dummy-" |
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 |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/usr/bin/env bash | ||
|
||
exit 0 |
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
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 |
---|---|---|
@@ -0,0 +1,29 @@ | ||
#!/usr/bin/env bats | ||
|
||
load test_helpers | ||
|
||
setup() { | ||
setup_asdf_dir | ||
install_dummy_plugin | ||
} | ||
|
||
teardown() { | ||
clean_asdf_dir | ||
} | ||
|
||
@test "plugin_remove command removes the plugin directory" { | ||
run asdf install dummy 1.0 | ||
[ "$status" -eq 0 ] | ||
[ -d "$ASDF_DIR/downloads/dummy" ] | ||
|
||
|
||
run asdf plugin-remove "dummy" | ||
[ "$status" -eq 0 ] | ||
[ ! -d "$ASDF_DIR/downloads/dummy" ] | ||
} | ||
|
||
@test "plugin_remove command fails if the plugin doesn't exist" { | ||
run asdf plugin-remove "does-not-exist" | ||
[ "$status" -eq 1 ] | ||
echo "$output" | grep "No such plugin: does-not-exist" | ||
} |
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
Oops, something went wrong.