Skip to content

Commit

Permalink
simplify code, remove else parts not needed
Browse files Browse the repository at this point in the history
  • Loading branch information
Mrfai committed Dec 5, 2020
1 parent 41478f6 commit 6d4bde0
Showing 1 changed file with 14 additions and 13 deletions.
27 changes: 14 additions & 13 deletions bin/fai-sed
Original file line number Diff line number Diff line change
Expand Up @@ -63,22 +63,23 @@ res=$?
if [ $res -eq 2 ]; then
printf " diff error $res. No changes made to $filename\n"
exit 2
elif [ $res -eq 0 ]; then
fi

if [ $res -eq 0 ]; then
printf " No changes.\n"
if [ $dryrun -eq 1 ]; then
exit 0
fi
else
exit 0
fi

if [ $res -eq 1 ]; then
if [ $dryrun -eq 1 ]; then
printf " Dry-run. Changes not applied.\n"
exit 0
else
mv $tmp $filename
printf " File changed.\n"
trap '' EXIT
if [ $showchanged -eq 1 ]; then
exit 9
fi
exit 0
fi
mv $tmp $filename
printf " File changed.\n"
trap '' EXIT
if [ $showchanged -eq 1 ]; then
exit 9
fi
exit 0
fi

0 comments on commit 6d4bde0

Please sign in to comment.