Add ledgerbil command helper
This commit is contained in:
parent
963aa81436
commit
ada3fce905
3
.env
3
.env
@ -2,7 +2,8 @@
|
||||
CONFIG_DIR=config
|
||||
|
||||
# The parent folder containing your ledger files.
|
||||
LEDGER_DIR=data
|
||||
# This must be an absolute path.
|
||||
LEDGER_DIR=/home/my-username/metaledger/data
|
||||
|
||||
# The name of your primary ledger file (within the LEDGER_DIR).
|
||||
PRIMARY_LEDGER_FILE=all.ledger
|
||||
|
22
bin/ledgerbil
Normal file → Executable file
22
bin/ledgerbil
Normal file → Executable file
@ -1,3 +1,23 @@
|
||||
#!/bin/bash
|
||||
|
||||
echo TODO
|
||||
# https://github.com/scarpent/ledgerbil
|
||||
|
||||
SCRIPTPATH="$( cd -- "$(dirname "$0")" >/dev/null 2>&1 ; pwd -P )"
|
||||
REPOPATH="$(dirname ${SCRIPTPATH})"
|
||||
|
||||
source ${REPOPATH}/.env
|
||||
|
||||
if ! docker image inspect "ledgerbil:latest" >/dev/null 2>&1; then
|
||||
echo "Ledgerbil image not found. Building..."
|
||||
git submodule update --init
|
||||
pushd ledgerbil
|
||||
docker build -t ledgerbil:latest .
|
||||
popd
|
||||
fi
|
||||
|
||||
docker run --rm -it \
|
||||
-v "${LEDGER_DIR}:/data" \
|
||||
-v "${REPOPATH}/ledgerbil-settings.py:/code/ledgerbil/settings.py" \
|
||||
--entrypoint python \
|
||||
ledgerbil:latest \
|
||||
/code/main.py -f /data/${PRIMARY_LEDGER_FILE} ${@}
|
||||
|
Reference in New Issue
Block a user