Skip to content

Commit 7256a20

Browse files
committed
lint
1 parent adbfa9d commit 7256a20

File tree

1 file changed

+6
-10
lines changed

1 file changed

+6
-10
lines changed

scripts/bash/backendStartDev.sh

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,10 @@ set -e
99
DIR=$(cd -- "$(dirname -- "${BASH_SOURCE[0]}")" &>/dev/null && pwd)
1010
. "$DIR/ansiControlSequences.sh"
1111

12-
USAGE="Usage: ${BOLD}backendStartDev babel_port_inspector${RESET} [${BOLD}-i${RESET}|${BOLD}--include-internal${RESET}] [${BOLD}-ts${RESET}|${BOLD}--typescript${RESET}]"
1312
watch_flags=''
1413
include_internal=false
1514
type_script=false
16-
inspect_port=${1}
15+
inspect_port=$1
1716

1817
# Start server command for JS
1918
start_server="nodemon -w src --exec \"babel-node src --inspect=${inspect_port} --config-file '../../babel.config.json'\""
@@ -28,29 +27,26 @@ while [[ $2 != '' ]]; do
2827
include_internal=true
2928
shift
3029
;;
31-
-s | --skip-internal)
32-
echo -e "Skipping internal dependencies is now done by default. Remove the ${BOLD}--skip-internal${RESET} (${BOLD}-s${RESET}) flag, and if you want to include internal dependencies, add a ${BOLD}-i${RESET}. (Do try it - it’s a lot faster than it used to be, because it only builds those relevant to the current package$EXCLAMATION_MARK)"
33-
exit 1
34-
;;
3530
*)
36-
echo -e "$USAGE"
31+
echo -e "Usage: ${BOLD}backendStartDev babel_port_inspector${RESET} [${BOLD}-i${RESET}|${BOLD}--include-internal${RESET}] [${BOLD}-ts${RESET}|${BOLD}--typescript${RESET}]"
3732
exit 1
3833
;;
3934
esac
4035
done
4136

4237
# Start server command for TS
4338
if [[ $type_script = true ]]; then
44-
start_server="nodemon --watch src -e ts,json,js --exec node --inspect=${inspect_port} -r ts-node/register src/index.ts"
39+
start_server="nodemon --watch src -e ts,json,js --exec node --inspect=${inspect_port@Q} -r ts-node/register src/index.ts"
4540
fi
4641

4742
echo -e "${BOLD}Starting server...${RESET}"
4843

4944
# If internal dependencies are included, add them to the watch list. This will watch for changes to the dist folder of each internal dependency. If the internal dependency then gets rebuilt, the server will restart.
5045
if [[ $include_internal = true ]]; then
5146
echo 'Internal dependencies are under watch for hot reload'
52-
for PACKAGE in $("$DIR/getInternalDependencies.sh"); do
53-
watch_flags+=" --watch ../$PACKAGE/dist"
47+
for package in $("$DIR"/getInternalDependencies.sh); do
48+
dist_path=../$package/dist
49+
watch_flags+=" --watch ${dist_path@Q}"
5450
done
5551
# add the watch flags to the server start process, as well as a 1 second delay to debounce the
5652
# many restarts that otherwise happen during the initial build of internal dependencies

0 commit comments

Comments
 (0)