Skip to content

Quote paths in shell commands to support directories with spaces#102

Merged
marcprux merged 2 commits intoskiptools:mainfrom
wjdtjq6:fix/spaces-in-directory-paths
Feb 4, 2026
Merged

Quote paths in shell commands to support directories with spaces#102
marcprux merged 2 commits intoskiptools:mainfrom
wjdtjq6:fix/spaces-in-directory-paths

Conversation

@wjdtjq6
Copy link
Contributor

@wjdtjq6 wjdtjq6 commented Jan 30, 2026

The buildAndroidSwiftPackageDebug and buildLocalSwiftPackage Gradle tasks pass paths to sh -c without shell quoting. When any path in the chain contains spaces (e.g. "Test Dir/app-project/..."), shell word splitting breaks the command arguments, causing errors like:

error: 4 unexpected arguments:
'Dir/app-project/.build/Android/AppName/jni-libs' ...

Add double quotes around all path-containing interpolations in the shell command strings: skipcmd, swiftBuildFolder(), swiftSourceFolder(), and the module-cache-path argument.

Fixes skiptools/skip#604

Thank you for contributing to the Skip project! Please use this space to describe your change and add any labels (bug, enhancement, documentation, etc.) to help categorize your contribution.

Please review the contribution guide at https://skip.dev/docs/contributing/ for advice and guidance on making high-quality PRs.

Skip Pull Request Checklist:

  • REQUIRED: I have signed the Contributor Agreement
  • REQUIRED: I have tested my change locally with swift test
  • OPTIONAL: I have tested my change on an iOS simulator or device
  • OPTIONAL: I have tested my change on an Android emulator or device

The buildAndroidSwiftPackageDebug and buildLocalSwiftPackage Gradle
tasks pass paths to sh -c without shell quoting. When any path in the
chain contains spaces (e.g. "Test Dir/app-project/..."), shell word
splitting breaks the command arguments, causing errors like:

  error: 4 unexpected arguments:
    'Dir/app-project/.build/Android/AppName/jni-libs' ...

Add double quotes around all path-containing interpolations in the
shell command strings: skipcmd, swiftBuildFolder(), swiftSourceFolder(),
and the module-cache-path argument.

Fixes skiptools/skip#604
@cla-bot
Copy link

cla-bot bot commented Jan 30, 2026

Thank you for your pull request and welcome to the Skip community. We require contributors to sign our contributor license agreement (CLA), and we don't seem to have the user(s) @wjdtjq6 on file. In order for us to review and merge your code, for each noted user please add your GitHub username to Skip's .clabot file

@cla-bot cla-bot bot added the cla-signed label Jan 31, 2026
@marcprux
Copy link
Member

marcprux commented Feb 2, 2026

This looks good, thanks for the contribution.

I'll merge it and cut a new release in the next few days.

@marcprux marcprux merged commit cc7661c into skiptools:main Feb 4, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

skip export fails when run in a directory with spaces

2 participants