Skip to content

Instantly share code, notes, and snippets.

@drrost
Last active December 11, 2019 13:20
Show Gist options
  • Save drrost/a1e52a72e3c4583310336cd1c9dd02f9 to your computer and use it in GitHub Desktop.
Save drrost/a1e52a72e3c4583310336cd1c9dd02f9 to your computer and use it in GitHub Desktop.
import Foundation
func readVariable(_ name: String) -> String {
if let value = ProcessInfo.processInfo.environment[name] {
return value
}
return ""
}
let homePath = readVariable("HOME")
print(homePath)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment