From 4a3232199f102140108ead92ed89cd58213113e2 Mon Sep 17 00:00:00 2001 From: Ben Yohay Date: Wed, 29 Dec 2021 14:06:18 +0200 Subject: [PATCH] GRDB: quote `PROJECT_DIR` and `SRCROOT` environment variables. Using those variables without quoting will yield unexpected results if they contain spaces. --- GRDB.xcodeproj/project.pbxproj | 6 +++--- GRDBCustom.xcodeproj/project.pbxproj | 4 ++-- Scripts/swiftlint.sh | 2 +- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/GRDB.xcodeproj/project.pbxproj b/GRDB.xcodeproj/project.pbxproj index 5a1a122d4..0e9aa5d59 100755 --- a/GRDB.xcodeproj/project.pbxproj +++ b/GRDB.xcodeproj/project.pbxproj @@ -2861,7 +2861,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "${PROJECT_DIR}/Scripts/swiftlint.sh\n"; + shellScript = "\"${PROJECT_DIR}/Scripts/swiftlint.sh\"\n"; }; 56EB54FA22C9115E00850069 /* Swiftlint */ = { isa = PBXShellScriptBuildPhase; @@ -2879,7 +2879,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "${PROJECT_DIR}/Scripts/swiftlint.sh\n"; + shellScript = "\"${PROJECT_DIR}/Scripts/swiftlint.sh\"\n"; }; AAA4DCFA230F1E0600C74B15 /* Swiftlint */ = { isa = PBXShellScriptBuildPhase; @@ -2897,7 +2897,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "${PROJECT_DIR}/Scripts/swiftlint.sh\n"; + shellScript = "\"${PROJECT_DIR}/Scripts/swiftlint.sh\"\n"; }; /* End PBXShellScriptBuildPhase section */ diff --git a/GRDBCustom.xcodeproj/project.pbxproj b/GRDBCustom.xcodeproj/project.pbxproj index 921bf2c8e..c69d0f931 100755 --- a/GRDBCustom.xcodeproj/project.pbxproj +++ b/GRDBCustom.xcodeproj/project.pbxproj @@ -2227,7 +2227,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "${PROJECT_DIR}/Scripts/swiftlint.sh\n"; + shellScript = "\"${PROJECT_DIR}/Scripts/swiftlint.sh\"\n"; }; 56EB54FD22C9119B00850069 /* Swiftlint */ = { isa = PBXShellScriptBuildPhase; @@ -2245,7 +2245,7 @@ ); runOnlyForDeploymentPostprocessing = 0; shellPath = /bin/sh; - shellScript = "${PROJECT_DIR}/Scripts/swiftlint.sh\n"; + shellScript = "\"${PROJECT_DIR}/Scripts/swiftlint.sh\"\n"; }; EED476F01CFD0B290026A4EC /* Copy .example configuration files (if no USER customizations exist) */ = { isa = PBXShellScriptBuildPhase; diff --git a/Scripts/swiftlint.sh b/Scripts/swiftlint.sh index 7781c40d8..02da30ab1 100755 --- a/Scripts/swiftlint.sh +++ b/Scripts/swiftlint.sh @@ -8,7 +8,7 @@ if test -d "/opt/homebrew/bin/"; then fi if which swiftlint >/dev/null; then - swiftlint --config ${SRCROOT}/Scripts/swiftlint.yml + swiftlint --config "${SRCROOT}/Scripts/swiftlint.yml" else echo "warning: SwiftLint not installed, download from https://github.com/realm/SwiftLint" fi