From 9850545f1b1b986610c114cd44f720487a36d31b Mon Sep 17 00:00:00 2001 From: Harvey Tindall Date: Sat, 5 Sep 2020 17:32:13 +0100 Subject: [PATCH] add version to default config file --- .goreleaser.yml | 2 +- Makefile | 2 +- config/generate_ini.py | 9 ++++++--- 3 files changed, 8 insertions(+), 5 deletions(-) diff --git a/.goreleaser.yml b/.goreleaser.yml index 0cfe1f8..80bc36c 100644 --- a/.goreleaser.yml +++ b/.goreleaser.yml @@ -10,7 +10,7 @@ before: hooks: # You may remove this if you don't use go modules. - go mod download - - python3 config/fixconfig.py -i config/config-base.json -o data/config-base.json + - python3 config/fixconfig.py -i config/config-base.json -o data/config-base.json --version {{.Version}} - python3 config/generate_ini.py -i config/config-base.json -o data/config-default.ini - python3 -m pip install libsass - python3 scss/get_node_deps.py diff --git a/Makefile b/Makefile index f7d018b..5e903ed 100644 --- a/Makefile +++ b/Makefile @@ -2,7 +2,7 @@ configuration: echo "Fixing config-base" python3 config/fixconfig.py -i config/config-base.json -o data/config-base.json echo "Generating config-default.ini" - python3 config/generate_ini.py -i config/config-base.json -o data/config-default.ini + python3 config/generate_ini.py -i config/config-base.json -o data/config-default.ini --version git sass: echo "Getting libsass" diff --git a/config/generate_ini.py b/config/generate_ini.py index 381d126..7974358 100644 --- a/config/generate_ini.py +++ b/config/generate_ini.py @@ -7,6 +7,7 @@ from pathlib import Path parser = argparse.ArgumentParser() parser.add_argument("-i", "--input", help="input config base from jf-accounts") parser.add_argument("-o", "--output", help="output ini") +parser.add_argument("--version", help="version to include in file") def generate_ini(base_file, ini_file, version): @@ -43,6 +44,8 @@ def generate_ini(base_file, ini_file, version): args = parser.parse_args() -print(generate_ini(base_file=args.input, - ini_file=args.output, - version="0.1.0")) +version = "git" +if args.version is not None: + version = args.version + +print(generate_ini(base_file=args.input, ini_file=args.output, version=version))