Skip to content

Commit

Permalink
Fix SC2088 shellcheck
Browse files Browse the repository at this point in the history
  • Loading branch information
Antiz96 committed Jun 9, 2023
1 parent 93bafb7 commit 65e2587
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/script/malias.sh
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ invalid_argument() {

# Definition of the backup_bashrc function: Create a backup of the .bashrc file (used in the "add" and "delete" function)
backup_bashrc() {
if cp -p ~/.bashrc "~/.bashrc-bck_${name}-${operation}-${alias_name}"; then
if cp -p ~/.bashrc ~/".bashrc-bck_${name}-${operation}-${alias_name}"; then
echo -e "\nBackup of the .bashrc file created"
else
echo -e >&2 "\nERROR: An error occured when creating the backup of the .bashrc file"
Expand All @@ -63,7 +63,7 @@ check_bashrc_error() {
;;
esac

rm -f "~/.bashrc-bck_${name}-${operation}-${alias_name}"
rm -f ~/".bashrc-bck_${name}-${operation}-${alias_name}"
echo "Backup of the .bashrc file deleted"
exec bash
else
Expand All @@ -76,7 +76,7 @@ check_bashrc_error() {
;;
esac

if mv -f "~/.bashrc-bck_${name}-${operation}-${alias_name}" ~/.bashrc; then
if mv -f ~/".bashrc-bck_${name}-${operation}-${alias_name}" ~/.bashrc; then
echo "Backup of the .bashrc file restored"
else
echo -e >&2 "ERROR: An error occurred when restoring the backup of the ~/.bashrc file\nPlease, check for potential errors in it"
Expand Down

0 comments on commit 65e2587

Please sign in to comment.