Skip to content

package-path option of swift run and shusky seems to enter in conflict in Swift 5.4 #49

@didix21

Description

@didix21

Describe the bug
swift run command has an option called --package-path which allow the user to specify where the Package.swift is, and shusky install has a custom option --package-path for specifying the Package.swift path. After updating to XCode 12.5. If you use both option in each command, they enter in conflict.

To Reproduce

  1. Create a new directory and run git init.
  2. Inside it, create a new path and add Package.swift with shusky.
  3. cd .. && mkdir another-path && cd another-path.
  4. Now run swift run -c release --package-path ../BuildTools shusky install --package-path BuildTools.

The following error is shown:

error: chdir error: No such file or directory (2): /Users/user-name/repos/shusky-test/another-path/BuildTools

Expected behavior
Install shusky correctly and create .shusky.yml and .git/hooks/pre-commit with the following content:

if [[ -f ./BuildTools/.build/release/shusky ]]; then
   ./BuildTools/ .build/release/shusky run pre-commit
else
    swift run -c release --package-path BuildTools shusky run pre-commit
fi

Desktop (please complete the following information):

  • OS: macOS Big Sur v11.4
  • XCode v12.5
  • Swift v5.4
  • shusky v1.3.0

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions