From b8aee8200f7d2bfdce933d9c7d427a21fe0d6d21 Mon Sep 17 00:00:00 2001 From: Llewellyn van der Merwe Date: Tue, 20 Apr 2021 18:52:27 +0200 Subject: [PATCH] Fixed conf path in download python script --- run.sh | 3 ++- src/download.py | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/run.sh b/run.sh index 2940222..9de8ae6 100755 --- a/run.sh +++ b/run.sh @@ -71,7 +71,7 @@ function getModules () { sleep 1 echo -e "XXX\n0\nStart download of modules... \nXXX" sleep 1 - python3 -u "${DIR_src}/download.py" --output_path "${modules_path}" + python3 -u "${DIR_src}/download.py" --output_path "${modules_path}" --conf_dir "${DIR_conf}" sleep 1 echo -e "XXX\n100\nDone downloading modules... \nXXX" sleep 2 @@ -297,6 +297,7 @@ if (( "$SHOWCONF" == 1 )); then echo "DIR_api: ${DIR_api}" echo "DIR_zip: ${DIR_zip}" echo "DIR_src: ${DIR_src}" + echo "DIR_conf: ${DIR_conf}" echo "DOWNLOAD: ${DOWNLOAD}" echo "PUSH: ${PUSH}" exit diff --git a/src/download.py b/src/download.py index f6aadfb..35050db 100644 --- a/src/download.py +++ b/src/download.py @@ -2,14 +2,15 @@ import os, os.path, json, urllib, urllib.request, sys, zipfile, shutil, argparse parser = argparse.ArgumentParser() # get the arguments -parser.add_argument('--output_path', help='The local path like "V2"', default="V2") +parser.add_argument('--output_path', help='The local path like "/home/username/sword_zip"', default="sword_zip") +parser.add_argument('--conf_dir') # set to args args = parser.parse_args() # this is a full path MAIN_PATH = args.output_path # some helper dictionaries -v1_translation_names = json.loads(open("../conf/CrosswireModulesMap.json").read()) +v1_translation_names = json.loads(open(args.conf_dir + "/conf/CrosswireModulesMap.json").read()) # scripts directory CURRENT_DIR = os.path.dirname(os.path.realpath(__file__))