summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2015-02-17 16:53:02 +0100
committerJonas Smedegaard <dr@jones.dk>2015-02-17 16:53:02 +0100
commit4b75c99ee7dc04285dcd9a204ad7430254f1455c (patch)
treeb66b3e92af550ead7eb46885ce3133f61f82fd0b
parent5286776eb41c6c742d1434f73b2dd8a819b18019 (diff)
Fix apply simple-suffix CSV rules first.
-rwxr-xr-xbin/mycsv2ledger7
1 files changed, 5 insertions, 2 deletions
diff --git a/bin/mycsv2ledger b/bin/mycsv2ledger
index b13e1b7..d01ced6 100755
--- a/bin/mycsv2ledger
+++ b/bin/mycsv2ledger
@@ -7,6 +7,9 @@ basename=$(basename "$infile" .csv)
outfile="${2:-$basename.ledger}"
rulesfile="$basename.rules"
-cat "$basename".*.rules > "$rulesfile"
+{
+ find * -name "$infile.rules" -execdir cat '{}' +;
+ find * -name "$basename.*.rules" \! -name "$infile.rules" -execdir cat '{}' +;
+} > "$rulesfile"
hledger print --rules-file "$rulesfile" -f "$infile" > "$outfile"
-[ "-d" = "$2" ] || rm "$rulesfile"
+rm "$rulesfile"