feat: Corrections shellcheck

This commit is contained in:
Xavier Logerais
2024-06-28 10:28:56 +00:00
parent 268ad94470
commit c2c0a11402
4 changed files with 16 additions and 18 deletions

View File

@@ -1,19 +1,19 @@
#!/bin/bash
note () {
note() {
# if file doesn't exist, create it
if [[ ! -f $HOME/.notes ]]; then
touch $HOME/.notes
touch "$HOME"/.notes
fi
if [[ $# -eq 0 ]]; then
# no arguments, print file
cat $HOME/.notes
cat "$HOME"/.notes
elif [[ "$1" == "-c" ]]; then
# clear file
echo "" > $HOME/.notes
echo "" >"$HOME"/.notes
else
# add all arguments to file
echo "$@" >> $HOME/.notes
echo "$@" >>"$HOME"/.notes
fi
}