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

fix: don't generate on error if backup file doesn't exists #1057

Merged
merged 1 commit into from Dec 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion lib/commands/command-reshim.bash
Expand Up @@ -70,7 +70,7 @@ write_shim_script() {
if [ -f "$shim_path" ]; then
if ! grep -x "# asdf-plugin: ${plugin_name} ${version}" "$shim_path" >/dev/null; then
sed -i.bak -e "s/exec /# asdf-plugin: ${plugin_name} ${version}\\"$'\n''exec /' "$shim_path"
rm "$shim_path".bak
rm -f "$shim_path".bak
fi
else
cat <<EOF >"$shim_path"
Expand Down
2 changes: 1 addition & 1 deletion lib/commands/reshim.bash
Expand Up @@ -20,6 +20,6 @@ remove_shim_for_version() {

if ! grep "# asdf-plugin:" "$shim_path" >/dev/null ||
[ "$count_installed" -eq 0 ]; then
rm "$shim_path"
rm -f "$shim_path"
fi
}
2 changes: 1 addition & 1 deletion lib/commands/version_commands.bash
Expand Up @@ -60,7 +60,7 @@ version_command() {

if [ -f "$file" ] && grep "^$plugin_name " "$file" >/dev/null; then
sed -i.bak -e "s|^$plugin_name .*$|$plugin_name ${resolved_versions[*]}|" "$file"
rm "$file".bak
rm -f "$file".bak
else
printf "%s %s\\n" "$plugin_name" "${resolved_versions[*]}" >>"$file"
fi
Expand Down