Reputation: 43
I am building a pre commit code that run dry run with the staged files to the target org.
Everything was working fine until if there are any spaces in the staged file inside the force-app.
pre-commit file code in husky
STAGED_FILES=$(git diff --name-only --cached | grep "^force-app/" | sed 's/.*/"&"/' | paste -sd "," -)
set -e
echo "STAGED_FILES: $STAGED_FILES"
if [ -n "$STAGED_FILES" ]; then
echo "Generating manifest..."
MANIFEST_OUTPUT=$(sf project generate manifest --output-dir ./manifest -p "$STAGED_FILES" || true)
............................
Error:
STAGED_FILES: "force-app/main/default/flexipages/Account_Record_Page_WCC.flexipage-meta.xml","force-app/main/default/layouts/Account-Account Layout.layout-meta.xml" Generating manifest... 'C:\Program' is not recognized as an internal or external command, operable program or batch file.
Note that if there are no spaces in the staged files, then its working as expected.
Upvotes: 0
Views: 29