Skip to content
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

Hyphen or Space? #195

Open
jradxl opened this issue Sep 3, 2024 · 1 comment
Open

Hyphen or Space? #195

jradxl opened this issue Sep 3, 2024 · 1 comment

Comments

@jradxl
Copy link

jradxl commented Sep 3, 2024

I'm coming from Linux experience and have been investigating whether I can use Swiftlang for general scripting instead of Bash.
I came across this repo, but the documentation is very confusing as you write "swift sh" in most places.

I'm using 5.10.1, and swift-sh builds without issue.
I copy .build/debug/swift-sh to /usr/local/bin as I would expect

I then use the Promise Example as follows:

$ cat script 
#!/usr/bin/env swift-sh
import PromiseKit  // @mxcl ~> 6.5
print(Promise.value("Hi!"))

Please note I use "swift-sh" as based on my Linux experience, "swift sh" does not work.
My script above works fine, and I am very impressed.

Are these "swift sh" un-noticed typos, or is there something else I should know.

@mxcl
Copy link
Owner

mxcl commented Sep 5, 2024

swift is a launcher. swift foo will cause swift to search for swift-foo in the PATH and launch that if it finds it. So both work. Sorry if the docs are confusing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants