diff options
author | InigoGutierrez <inigogf.95@gmail.com> | 2023-03-10 18:55:03 +0100 |
---|---|---|
committer | InigoGutierrez <inigogf.95@gmail.com> | 2023-03-10 18:55:03 +0100 |
commit | 7212da7e707a9e17b7182281e4d912a88f7f9cea (patch) | |
tree | 7b9554ca8cc17f7fc52126fe2f35bb4169e2951e | |
parent | 66997994dfa762532dcf52e4834281f7368f0a08 (diff) | |
download | scripts-7212da7e707a9e17b7182281e4d912a88f7f9cea.tar.gz scripts-7212da7e707a9e17b7182281e4d912a88f7f9cea.zip |
Fixed quickLedger.sh not downloading remote ledger prior to editing.
-rwxr-xr-x | quickLedger.sh | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/quickLedger.sh b/quickLedger.sh index b0b9879..d7b061b 100755 --- a/quickLedger.sh +++ b/quickLedger.sh @@ -84,6 +84,11 @@ while getopts ':tf:r:c:' opt; do done shift $((OPTIND - 1)) +[ -z "$remoteLedgerFile" ] && + fatalError 'No remote ledger file. Set ledger file as REMOTE_LEDGER_FILE variable or with -r option.\n' 2 + +rsync -tz "$remoteLedgerFile" "$ledgerFile" || fatalError 'rsync failed.' 4 + [ -z "$ledgerFile" ] && fatalError 'No ledger file. Set ledger file as LEDGER_FILE variable or with -f option.\n' 2 [ ! -f "$ledgerFile" ] && fatalError "No file [${ledgerFile}] found to use as ledger.\n" 3 @@ -114,4 +119,4 @@ read -r correct printf '\n' >> "$ledgerFile" getTransaction >> "$ledgerFile" -rsync -t "$ledgerFile" "$remoteLedgerFile" || fatalError 'rsync failed.' 4 +rsync -tz "$ledgerFile" "$remoteLedgerFile" || fatalError 'rsync failed.' 4 |