From 01f634f40e50368073b7382d69502170e776a6e6 Mon Sep 17 00:00:00 2001 From: Ala Shaabana Date: Tue, 13 Jun 2023 14:27:53 -0400 Subject: [PATCH 1/2] Some fixes to cmd line argument processing to make things simpler --- run.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/run.sh b/run.sh index dd770bd..cae450b 100755 --- a/run.sh +++ b/run.sh @@ -148,11 +148,12 @@ strip_quotes() { # Parse command line arguments while [[ "$#" -gt 0 ]]; do + echo $1 case $1 in --script) script="$2"; shift ;; --name) name="$2"; shift ;; - --*) args+=("$1=$2"); shift ;; - *) echo "Unknown parameter passed: $1"; exit 1 ;; + --*) shift ;; + *) shift ;; esac shift done @@ -178,7 +179,6 @@ fi # Run the Python script with the arguments using pm2 echo "Running $script with the following arguments with pm2:" -echo "${args[@]}" pm2 start "$script" --name $proc_name --interpreter python3 -- "${args[@]}" # Check if packages are installed. From 3d61b84fb5b91d0ae298144798580336b0500138 Mon Sep 17 00:00:00 2001 From: Ala Shaabana Date: Tue, 13 Jun 2023 14:29:14 -0400 Subject: [PATCH 2/2] Removed echo of cmd line arguments --- run.sh | 1 - 1 file changed, 1 deletion(-) diff --git a/run.sh b/run.sh index cae450b..dc4254e 100755 --- a/run.sh +++ b/run.sh @@ -148,7 +148,6 @@ strip_quotes() { # Parse command line arguments while [[ "$#" -gt 0 ]]; do - echo $1 case $1 in --script) script="$2"; shift ;; --name) name="$2"; shift ;;