Fixed PATH, and several conditionals

This commit is contained in:
Trey Blancher 2023-10-02 16:55:05 -04:00
parent 787c4c5b2f
commit bcfb55a4be
1 changed files with 5 additions and 4 deletions

View File

@ -1,8 +1,9 @@
#!/bin/bash
PATH=/Users/tblancher/homebrew/Cellar/gnu-tar/1.34_1/libexec/gnubin:/Users/tblancher/homebrew/Cellar/coreutils/9.1/libexec/gnubin:/Users/tblancher/homebrew/bin
PATH=/Users/tblancher/homebrew/opt/coreutils/libexec/gnubin:/Users/tblancher/homebrew/opt/gnu-tar/libexec/gnubin:/Users/tblancher/bin:/Users/tblancher/homebrew/bin:/Users/tblancher/homebrew/sbin:/Users/tblancher/gem/bin:/usr/local/bin:/usr/bin:/bin:/usr/local/games:/sbin:/usr/sbin:/Users/tblancher/bin
MONTH=$(( $(date +%m) - 1 ))
if [ "x$1" == "x" ]
if [[ -z "$1" ]]
then
YEAR=$(( $(date +%Y) - 1))
ONESET=true
@ -15,9 +16,9 @@ if [ $MONTH -eq 0 ];
then
MONTH=12
if [[ ! ${ONESET} ]]; then
YEAR=$(( $YEAR - 1))
YEAR=$(( YEAR - 1))
fi
fi
tar -cvJf $YEAR.tar $YEAR-*.tar.xz --remove-files
tar -cvJf "$YEAR.tar" $YEAR-*.tar.xz --remove-files