Trying Managing Swift Environments with a Shell (Bash) 🌸 #swiftlang

Akashi Castle in Japan

Setting Environment Variables for Swift 3.0

To use Swift 3.0, we need to set the PATH and the TOOLCHAINS environment variables if using Xcode 7.3.

I have a STRONG interest in a shell, so I tried doing that with a shell. 😎

set-swift-env: External Shell Script File for OS X

Here is a shell script file to set environment variables for Swift 3.0. 💁


$ . set-swift-env

Please note, . (a period) makes the command execute in the current shell context. I think we can't set environment variables in an external shell script file without it. 🤔

Also, I have been developed utilities for Swift on my GitHub. It contains this script file.


By the way, there is a popular Swift Version Manager called swiftenv. swiftenv allows us to easily install, and switch between multiple versions of Swift. Here is the support page.

A lot of popular libraries are using it. ☺️

My shell script file's name is remarkably similar to swiftenv, but it has no relation to swiftenv. So, I might rename it. 😅