Skip to content

Commit

Permalink
fix: attempt to fix the single quote interference (#313)
Browse files Browse the repository at this point in the history
Single quotes are used in some names (like McGill's) and this causes an interference in the bash script that uses single quotes to delimit the python script arguments. This should fix it.
  • Loading branch information
fredericsimard authored Nov 27, 2023
1 parent 23145ba commit 8d127f3
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
2 changes: 1 addition & 1 deletion .github/workflows/add_new_or_updated_feeds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -92,7 +92,7 @@ jobs:
pip install gtfs_kit --quiet
pip install unidecode --quiet
sections=$(echo "${{ steps.process-csv.outputs.PYTHON_SCRIPT_ARGS }}" | sed 's/""/"/g' | awk -F'§' '{for (i=1; i<=NF; i++) print $i}')
sections=$(echo '${{ steps.process-csv.outputs.PYTHON_SCRIPT_ARGS }}' | sed 's/""/"/g' | awk -F'§' '{for (i=1; i<=NF; i++) print $i}')
for section in "${sections[@]}"; do
eval "python -c 'from tools.operations import *; ${section}'"
done
Expand Down
3 changes: 3 additions & 0 deletions scripts/process_csv_in_github_action.swift
Original file line number Diff line number Diff line change
Expand Up @@ -203,6 +203,9 @@ if CommandLine.argc == 5 {

} // END FOR LOOP

// Replace single quotes (like in McGill's) with an apostrophe so there is no interference with the bash script in the next step.
PYTHON_SCRIPT_OUTPUT = PYTHON_SCRIPT_OUTPUT.replacingOccurrences(of: "'", with: "ʼ")

// return final output so the action can grab it and pass it on to the Python script.
print(PYTHON_SCRIPT_OUTPUT.dropFirst())

Expand Down

0 comments on commit 8d127f3

Please sign in to comment.