Skip to content

Commit

Permalink
feat: changed from json array to bash array
Browse files Browse the repository at this point in the history
  • Loading branch information
kemboi22 committed Aug 11, 2024
1 parent 60e2922 commit 4fa5e42
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions imageroot/bin/create-site
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,13 @@
done;
echo "sites/common_site_config.json found";
bench new-site frontend --no-mariadb-socket --admin-password=admin --db-root-password="$MARIADB_ROOT_PASSWORD" --install-app erpnext --set-default;

# Loop through the modules and install ERP_NEXT_MODULES
for module in $ERP_NEXT_MODULES; do
echo "Installing $module";
bench --site frontend install-app "$module";
done;
# Convert the JSON-like string to a bash array
ERP_NEXT_MODULES=$(echo "$ERPNEXT_MODULES" | tr -d '[]' | tr -d '"' | tr -d ' ')
IFS=',' read -r -a ERP_NEXT_MODULES_ARRAY <<< "$ERP_NEXT_MODULES"
# Iterate over the array
for module in "${ERP_NEXT_MODULES_ARRAY[@]}"; do
echo "Processing $module"
# Add your logic here, e.g., installing apps
bench --site frontend install-app "$module"
done

0 comments on commit 4fa5e42

Please sign in to comment.