~breatheoutbreathein/hledger-import-new-xacts

7362504a8a40468ecab14377f6c155401d401736 — Joseph Turner 1 year, 10 months ago 2040454
Revert "Rename CSV_LENGTH_OFFSET -> SKIP_LINES"

This reverts commit cb6c209f825520dc005ad7afc3776347a560ed3b.
1 files changed, 4 insertions(+), 3 deletions(-)

M hledger-import-new-xact.sh
M hledger-import-new-xact.sh => hledger-import-new-xact.sh +4 -3
@@ 3,7 3,8 @@
JOURNAL="$1"
CSV="$2"
RULES="$3"
SKIP_LINES="${4:-0}" # Number of lines in the CSV before data (assuming there are no lines after data)
CSV_LENGTH_OFFSET="${4:-0}" # Number of lines in the CSV before/after data

CSV_BASENAME="${CSV##*/}"
CSV_DIRNAME="$(dirname $CSV)"



@@ 19,7 20,7 @@ TMP_CSV_LATEST="$TMP_DIR/.latest.$CSV_BASENAME.csv"
journal_length () { hledger -f "$1" stat | awk '/^Transactions  / { print $3 }'; }

# Check if running `hledger import` will create duplicate xacts.
duplicates_p () { test ! $(("$JOURNAL_LENGTH" + "$LINES_ADDED_LENGTH" + "$SKIP_LINES")) -eq "$CSV_LENGTH"; }
duplicates_p () { test ! $(("$JOURNAL_LENGTH" + "$LINES_ADDED_LENGTH" + "$CSV_LENGTH_OFFSET")) -eq "$CSV_LENGTH"; }

# Body



@@ 80,7 81,7 @@ was not equal to the sum of:

JOURNAL_LENGTH:       	$JOURNAL_LENGTH
LINES_ADDED_LENGTH:	$LINES_ADDED_LENGTH
SKIP_LINES:		$SKIP_LINES"
CSV_LENGTH_OFFSET:	$CSV_LENGTH_OFFSET"

        exit 1
    fi