Skip to content

Commit

Permalink
build: check if a file exists before removing it
Browse files Browse the repository at this point in the history
Not really all that necessary, but it's definitely a nice touch to avoid
errors when `rm` tries to remove a file that doesn't exist.
  • Loading branch information
vednoc committed Oct 26, 2020
1 parent cd87e94 commit c9289fd
Showing 1 changed file with 11 additions and 1 deletion.
12 changes: 11 additions & 1 deletion whatsapp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,20 @@ print() {
cat $input
}

remove_if_exists() {
if [ -f "$1" ]; then
rm "$1"
fi
}

remove() {
echo "Removing files..."

rm temp.styl darkmode.css custom.user.css
remove_if_exists temp.styl
remove_if_exists darkmode.css
remove_if_exists custom.user.css

echo "Done!"
}

compile() {
Expand Down

0 comments on commit c9289fd

Please sign in to comment.