-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
swift package init
creates a package in the current directory, rather than taking explicit input or using given package name as directory
#7791
Comments
I took a stab at this here: #7792 |
As any change in SwiftPMs public API and CLI commands, this seems significant enough to require a pitch and a subsequent Swift Evolution proposal if it's successful at the pitch phase. |
Sounds good. I can put together a pitch for this then 👍 For my understanding, which part of this change do you deem significant/substantial? I'd love to use to that to refine the pitch. |
cc @bnbarham |
You can pass an explicit path using |
I'd say it's worth talking about on the forums at minimum - there's a few ways this could be implemented. Some examples:
|
I like this. It's consistent use of
And I don't mind this. |
I personally prefer consistency with the other subcommands, i.e. |
Description
This can often clutter up or conflict with content in the current directory and create a confusing experience for folks who aren't familiar with the undocumented behavior of where
swift package init
will place content.This also gets confusing with the
--name
parameter, which might lead folks to believe that the package will be placed in a directory named that name.Expected behavior
swift package init
takes in an argument for the directory to place the package into.Actual behavior
swift package init
always creates a package in the current working directory.Steps to reproduce
swift package init
with no argumentsswift package init --name SomePkg
SomePkg
directoryswift package init --name SomePkg MyPkg
error: Unexpected argument 'MyPkg'
Swift Package Manager version/commit hash
691f931
Swift & OS version (output of
swift --version && uname -a
)swift-driver version: 1.111.2 Apple Swift version 6.0 (swiftlang-6.0.0.5.15 clang-1600.0.22.6)
Target: arm64-apple-macosx14.0
Darwin Elis-MBP-3 23.6.0 Darwin Kernel Version 23.6.0: Wed Jul 10 01:20:40 PDT 2024; root:xnu-10063.141.1~4/RELEASE_ARM64_T6000 arm64
The text was updated successfully, but these errors were encountered: