Created
August 17, 2014 06:27
-
-
Save nntsugu/5a93bd537dbdf95de31d to your computer and use it in GitHub Desktop.
Swiftをコマンドライン(CLI)で実行する ref: http://qiita.com/nntsugu@github/items/17d344cb5f505051687d
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
export PATH=$PATH:`find /Applications/Xcode6-Beta*.app -name swift|grep bin|xargs -I{} dirname {}` | |
or | |
export PATH=$PATH:/path/to/swift_dir | |
~~~~~~~~~~~~~~~~~~ | |
↑↑↑ | |
## find /Applications/Xcode6-Beta*.app -name swift|grep bin|xargs -I{} dirname {} | |
## の結果を書けばOK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ export PATH=$PATH:`find /Applications/Xcode6-Beta*.app -name swift|grep bin|xargs -I{} dirname {}` | |
## Swift入りのXCodeはまだBeta版なので、find先を/Applications/Xcode6-Beta*.appとしています。 | |
## Betaが取れたら、適宜書き換えてください。たぶんXCodeでOK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ swift -h | |
でhelpが表示されればOK |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
var str = "Hello Swift World!!" | |
println(str) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
$ swift hello.swift | |
Hello Swift World!! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment