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__))