Skip to content

Instantly share code, notes, and snippets.

@artemnovichkov
Last active April 11, 2018 07:11
Show Gist options
  • Save artemnovichkov/83843bcddd37cc4f240a1204d6ec055b to your computer and use it in GitHub Desktop.
Save artemnovichkov/83843bcddd37cc4f240a1204d6ec055b to your computer and use it in GitHub Desktop.
Code example for the article "Swift, Plist and Two Smoking Scripts" https://medium.com/rosberryapps/swift-plist-and-two-smoking-scripts-94bb54cbeded
import Foundation
// Get project URL
guard let projectDirRawValue = getenv("PROJECT_DIR"),
let projectDirectoryPath = String(utf8String: projectDirRawValue) else {
exit(1)
}
let projectURL = URL(fileURLWithPath: projectDirectoryPath)
// Get Info.plist path
guard let productSettingsPathRawValue = getenv("PRODUCT_SETTINGS_PATH"),
let productSettingsPath = String(utf8String: productSettingsPathRawValue) else {
exit(1)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment