Skip to content

Commit 177640c

Browse files
committed
fix(project-template): Surround all paths in nsld.sh with quotes
Otherwise build fails for projects residing in directories containing spaces.
1 parent e1b8f95 commit 177640c

1 file changed

Lines changed: 5 additions & 5 deletions

File tree

  • build/project-template/internal

build/project-template/internal/nsld.sh

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,23 @@
11
#!/usr/bin/env bash
22
source ./.build_env_vars.sh
33

4-
MODULES_DIR=$SRCROOT/internal/Swift-Modules
4+
MODULES_DIR="$SRCROOT/internal/Swift-Modules"
55

66
function DELETE_SWIFT_MODULES_DIR() {
7-
rm -rf $MODULES_DIR
7+
rm -rf "$MODULES_DIR"
88
}
99

1010
function GEN_MODULEMAP() {
1111
SWIFT_HEADER_DIR=$PER_VARIANT_OBJECT_FILE_DIR
1212

1313
DELETE_SWIFT_MODULES_DIR
1414
if [ -d "$SWIFT_HEADER_DIR" ]; then
15-
HEADERS_PATHS=$(find $SWIFT_HEADER_DIR -name *-Swift.h 2>/dev/null)
15+
HEADERS_PATHS=$(find "$SWIFT_HEADER_DIR" -name *-Swift.h 2>/dev/null)
1616
if [ -n "$HEADERS_PATHS" ]; then
1717
# Workaround for ARCH being set to `undefined_arch` here. Get the newest -Swift.h
1818
# if more than one is found. It should be the one for the current architecture.
19-
HEADER_PATH=$(ls -t $HEADERS_PATHS | head -n 1)
20-
mkdir -p $MODULES_DIR
19+
HEADER_PATH=$(ls -t "$HEADERS_PATHS" | head -n 1)
20+
mkdir -p "$MODULES_DIR"
2121
CONTENT="module nsswiftsupport { \n header \"$HEADER_PATH\" \n export * \n}"
2222
printf "$CONTENT" > "$MODULES_DIR/module.modulemap"
2323
else

0 commit comments

Comments
 (0)