Skip to content

Commit 723458d

Browse files
committed
resolve absolute paths to increase script usability
1 parent 388cecd commit 723458d

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

woo.sh

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -415,7 +415,7 @@ info "arg_n: ${arg_n}"
415415

416416
# woo.sh
417417
echo "Now ready for GrahpQL server generation!"
418-
418+
input="$(pwd)/${arg_i}"
419419
config_file="$(cd "$(dirname "${arg_c}")" && pwd)/$(basename "${arg_c}")"
420420

421421
# Check if driver exists
@@ -443,27 +443,27 @@ else
443443
custom_resolvers=${__dir}/graphql-server/empty_custom_resolvers.js
444444
fi
445445

446-
echo ${arg_i}
447-
echo ${config_file}
448-
echo ${driver_dir}
449-
echo ${output_dir}
450-
echo ${custom_schema}
451-
echo ${custom_resolvers}
446+
echo "Input: ${arg_i}"
447+
echo "Output: ${output_dir}"
448+
echo "Config: ${config_file}"
449+
echo "Driver: ${driver_dir}"
450+
echo "Custom schema: ${custom_schema}"
451+
echo "Custom resolvers: ${custom_resolvers}"
452452

453453
# copy server files
454-
cp ./graphql-server/server.js ${output_dir}
454+
cp ${__dir}/graphql-server/server.js ${output_dir}
455455
cp ${driver_dir}/* ${output_dir}
456456
(cd ${output_dir}; npm install)
457457
# Hack: Modify executeFieldsSerially(...) in /node_modules/graphql/execution/execute.js
458458
# The mod is required to support nested transactions.
459-
cp ./graphql-server/graphql/execution/execution.js ${output_dir}/node_modules/graphql/execution/execute.js
459+
cp ${__dir}/graphql-server/graphql/execution/execution.js ${output_dir}/node_modules/graphql/execution/execute.js
460460
cp ${custom_schema} ${output_dir}/api-schema/custom-api-schema.graphql
461461
cp ${custom_resolvers} ${output_dir}/custom-resolvers.js
462462

463463
# generate GraphQL API schema (for now, assume that arg_i is a relative path/file)
464-
cd ./graphql-api-generator
464+
cd ${__dir}/graphql-api-generator
465465
python3 generator.py \
466-
--input ../${arg_i} \
466+
--input ${input} \
467467
--output ${output_dir}/api-schema/api-schema.graphql \
468468
--config ${config_file}
469469
cd ..

0 commit comments

Comments
 (0)