@@ -89,14 +89,12 @@ if [[ "$3" == "-v" || "$3" == "--verbose" ]]; then
8989 VERBOSE=1
9090fi
9191
92- current_dir=$( pwd)
93-
9492# Ensures that if any command in the pipeline fails (like npm run build), the entire pipeline
9593# will return a non-zero status, allowing the if condition to properly catch failures.
9694set -o pipefail
9795
9896# Define the path to the subfolder
99- NODE_SUBFOLDER=node_$1
97+ NODE_SUBFOLDER=$( dirname " $1 " ) / node_$( basename " $1 " )
10098
10199# Running React application
102100printf " ### Step 1: Starting the React application in folder $NODE_SUBFOLDER ...\n"
121119 mkdir -p $NODE_SUBFOLDER
122120fi
123121
124- cp -R $1 /* $NODE_SUBFOLDER
122+ cp -R " $1 " /* $NODE_SUBFOLDER
125123
126124# Move to the subfolder
127125cd " $NODE_SUBFOLDER " 2> /dev/null
202200# Execute all Cypress conformance tests in the build folder
203201printf " ### Step 2: Running Cypress conformance tests $2 ...\n"
204202
205- # Move back to the original directory
206- cd $current_dir
207-
208203# Define the path to the conformance tests subfolder
209- NODE_CONFORMANCE_TESTS_SUBFOLDER=node_$2
204+ NODE_CONFORMANCE_TESTS_SUBFOLDER=$( dirname " $2 " ) / node_$( basename " $2 " )
210205
211206if [ " ${VERBOSE:- } " -eq 1 ] 2> /dev/null; then
212207 printf " Preparing conformance tests Node subfolder: $NODE_CONFORMANCE_TESTS_SUBFOLDER \n"
228223 mkdir -p $NODE_CONFORMANCE_TESTS_SUBFOLDER
229224fi
230225
231- cp -R $2 /* $NODE_CONFORMANCE_TESTS_SUBFOLDER
226+ cp -R " $2 " /* $NODE_CONFORMANCE_TESTS_SUBFOLDER
232227
233228# Move to the subfolder with Cypress tests
234229cd " $NODE_CONFORMANCE_TESTS_SUBFOLDER " 2> /dev/null
0 commit comments