summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonas Smedegaard <dr@jones.dk>2019-09-24 13:47:27 +0200
committerJonas Smedegaard <dr@jones.dk>2019-09-24 13:47:27 +0200
commit8d0a7a03b99f85002568a1b5c5db241a2cd7e1cc (patch)
tree69eeb9907128b85bf23a2c91263cde738275c20a
parent02388a648b278678bbdb43f8ad39cce908b61e1f (diff)
Use include statements (not pipe).skat-2018
-rwxr-xr-xbin/myhledger19
-rw-r--r--data/2001/journal.ledger7
-rw-r--r--data/2003/journal.ledger7
-rw-r--r--data/2005/journal.ledger7
-rw-r--r--data/2006/journal.ledger7
-rw-r--r--data/2007/journal.ledger7
-rw-r--r--data/2008/journal.ledger7
-rw-r--r--data/2009/journal.ledger7
-rw-r--r--data/2010/journal.ledger7
-rw-r--r--data/2011/journal.ledger7
-rw-r--r--data/2012/journal.ledger7
-rw-r--r--data/2013/journal.ledger7
-rw-r--r--data/2014/journal.ledger7
-rw-r--r--data/2015/journal.ledger7
-rw-r--r--data/2016/journal.ledger7
-rw-r--r--data/2017/journal.ledger7
-rw-r--r--data/2018/journal.ledger7
-rw-r--r--data/2019/journal.ledger7
-rw-r--r--data/journal.ledger20
19 files changed, 140 insertions, 18 deletions
diff --git a/bin/myhledger b/bin/myhledger
index cf73eef..caa8cb3 100755
--- a/bin/myhledger
+++ b/bin/myhledger
@@ -15,22 +15,5 @@
set -e
basedir="${basedir:-data}"
-years="${years:-$(find "$basedir" -mindepth 1 -maxdepth 1 -type d -regex '.*/[0-9]+' -printf '%f\n')}"
-journal() {
- set -e
- cd "$basedir"
- for year in $years; do
- cat defaults.ledger 2> /dev/null || true
- cat $year/primo.ledger 2> /dev/null || true
- cat defaults.ledger 2> /dev/null || true
- cat $year/assets/*.ledger 2> /dev/null || true
- cat defaults.ledger 2> /dev/null || true
- cat $year/income/*.ledger 2> /dev/null || true
- cat defaults.ledger 2> /dev/null || true
- cat $year/expenses/*.ledger 2> /dev/null || true
- cat $year/ultimo.ledger 2> /dev/null || true
- done
-}
-
-journal | hledger -f- "$@"
+hledger -f "$basedir/journal.ledger" "$@"
diff --git a/data/2001/journal.ledger b/data/2001/journal.ledger
new file mode 100644
index 0000000..60e60bf
--- /dev/null
+++ b/data/2001/journal.ledger
@@ -0,0 +1,7 @@
+Y2001
+D 1.000,00 kr
+include primo.ledger
+#include assets/*.ledger
+#include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2003/journal.ledger b/data/2003/journal.ledger
new file mode 100644
index 0000000..eda8e4a
--- /dev/null
+++ b/data/2003/journal.ledger
@@ -0,0 +1,7 @@
+Y2003
+D 1.000,00 kr
+include primo.ledger
+#include assets/*.ledger
+#include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2005/journal.ledger b/data/2005/journal.ledger
new file mode 100644
index 0000000..cbfacdb
--- /dev/null
+++ b/data/2005/journal.ledger
@@ -0,0 +1,7 @@
+Y2005
+D 1.000,00 kr
+include primo.ledger
+#include assets/*.ledger
+#include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2006/journal.ledger b/data/2006/journal.ledger
new file mode 100644
index 0000000..6fa61cf
--- /dev/null
+++ b/data/2006/journal.ledger
@@ -0,0 +1,7 @@
+Y2006
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+#include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2007/journal.ledger b/data/2007/journal.ledger
new file mode 100644
index 0000000..03bd2bb
--- /dev/null
+++ b/data/2007/journal.ledger
@@ -0,0 +1,7 @@
+Y2007
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+#include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2008/journal.ledger b/data/2008/journal.ledger
new file mode 100644
index 0000000..83f4ccf
--- /dev/null
+++ b/data/2008/journal.ledger
@@ -0,0 +1,7 @@
+Y2008
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+#include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2009/journal.ledger b/data/2009/journal.ledger
new file mode 100644
index 0000000..2364436
--- /dev/null
+++ b/data/2009/journal.ledger
@@ -0,0 +1,7 @@
+Y2009
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+#include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2010/journal.ledger b/data/2010/journal.ledger
new file mode 100644
index 0000000..9e62d2f
--- /dev/null
+++ b/data/2010/journal.ledger
@@ -0,0 +1,7 @@
+Y2010
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+#include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2011/journal.ledger b/data/2011/journal.ledger
new file mode 100644
index 0000000..cd817aa
--- /dev/null
+++ b/data/2011/journal.ledger
@@ -0,0 +1,7 @@
+Y2011
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2012/journal.ledger b/data/2012/journal.ledger
new file mode 100644
index 0000000..91ef32d
--- /dev/null
+++ b/data/2012/journal.ledger
@@ -0,0 +1,7 @@
+Y2012
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2013/journal.ledger b/data/2013/journal.ledger
new file mode 100644
index 0000000..91e2644
--- /dev/null
+++ b/data/2013/journal.ledger
@@ -0,0 +1,7 @@
+Y2013
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2014/journal.ledger b/data/2014/journal.ledger
new file mode 100644
index 0000000..00c533e
--- /dev/null
+++ b/data/2014/journal.ledger
@@ -0,0 +1,7 @@
+Y2014
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2015/journal.ledger b/data/2015/journal.ledger
new file mode 100644
index 0000000..819b6ed
--- /dev/null
+++ b/data/2015/journal.ledger
@@ -0,0 +1,7 @@
+Y2015
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2016/journal.ledger b/data/2016/journal.ledger
new file mode 100644
index 0000000..c5b8d33
--- /dev/null
+++ b/data/2016/journal.ledger
@@ -0,0 +1,7 @@
+Y2016
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2017/journal.ledger b/data/2017/journal.ledger
new file mode 100644
index 0000000..f36f000
--- /dev/null
+++ b/data/2017/journal.ledger
@@ -0,0 +1,7 @@
+Y2017
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2018/journal.ledger b/data/2018/journal.ledger
new file mode 100644
index 0000000..f4c429b
--- /dev/null
+++ b/data/2018/journal.ledger
@@ -0,0 +1,7 @@
+Y2018
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/2019/journal.ledger b/data/2019/journal.ledger
new file mode 100644
index 0000000..2a54bc6
--- /dev/null
+++ b/data/2019/journal.ledger
@@ -0,0 +1,7 @@
+Y2019
+D 1.000,00 kr
+include primo.ledger
+include assets/*.ledger
+include income/*.ledger
+include expenses/*.ledger
+#include ultimo.ledger
diff --git a/data/journal.ledger b/data/journal.ledger
new file mode 100644
index 0000000..ff7eecf
--- /dev/null
+++ b/data/journal.ledger
@@ -0,0 +1,20 @@
+#include 2000/journal.ledger
+include 2001/journal.ledger
+#include 2002/journal.ledger
+include 2003/journal.ledger
+#include 2004/journal.ledger
+include 2005/journal.ledger
+include 2006/journal.ledger
+include 2007/journal.ledger
+include 2008/journal.ledger
+include 2009/journal.ledger
+include 2010/journal.ledger
+include 2011/journal.ledger
+include 2012/journal.ledger
+include 2013/journal.ledger
+include 2014/journal.ledger
+include 2015/journal.ledger
+include 2016/journal.ledger
+include 2017/journal.ledger
+include 2018/journal.ledger
+include 2019/journal.ledger