diff --git a/lib/commands/reshim.sh b/lib/commands/reshim.sh index 22c98b99..34987bb5 100644 --- a/lib/commands/reshim.sh +++ b/lib/commands/reshim.sh @@ -51,7 +51,7 @@ write_shim_script() { cp "$plugin_shims_path/$executable_name" "$shim_path" elif [ -f "$shim_path" ]; then if ! grep "# asdf-plugin-version: $version" "$shim_path" > /dev/null; then - sed "$shim_path" -i'' -e "s/\(asdf-plugin: $plugin_name\)/\1\n# asdf-plugin-version: $version/" + sed -i'' -e "s/\(asdf-plugin: $plugin_name\)/\1\\"$'\n'"# asdf-plugin-version: $version/" "$shim_path" fi else cat < "$shim_path" @@ -191,7 +191,7 @@ remove_shim_for_version() { return 0 fi - sed "$shim_path" -i'' -e "/# asdf-plugin-version: $version/d" + sed -i'' -e "/# asdf-plugin-version: $version/d" "$shim_path" if [ ! -f "$plugin_shims_path/$executable_name" ] && \ ! grep "# asdf-plugin-version" "$shim_path" > /dev/null || \ diff --git a/test/install_command.bats b/test/install_command.bats index 78779081..7d41ff4e 100644 --- a/test/install_command.bats +++ b/test/install_command.bats @@ -69,7 +69,7 @@ teardown() { [ "$status" -eq 0 ] lines_count=$(grep "asdf-plugin-version: 1.1" $ASDF_DIR/shims/dummy | wc -l) - [ "$lines_count" = "1" ] + [ "$lines_count" -eq "1" ] }