Skip to content

Instantly share code, notes, and snippets.

@TachibanaKaoru
Created February 22, 2018 07:43
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save TachibanaKaoru/4ffa5dda9b86b4f0ef1a02e064ba34e9 to your computer and use it in GitHub Desktop.
Save TachibanaKaoru/4ffa5dda9b86b4f0ef1a02e064ba34e9 to your computer and use it in GitHub Desktop.
change markdown to preview mode
#!/usr/bin/swift
import Foundation
let env = ProcessInfo.processInfo.environment
let manager = FileManager.default
let fileNakami = """
<?xml version="1.0" encoding=\"UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<array/>
</plist>
"""
if let pathValue = env["XcodeProjectPath"] as? String{
var fileURL = URL(fileURLWithPath: pathValue)
fileURL.appendPathComponent(".xcodesamplecode.plist")
try! fileNakami.write(to: fileURL, atomically: true, encoding: String.Encoding.utf8)
}
if let pathValue = env["XcodeWorkspacePath"] as? String{
var fileURL = URL(fileURLWithPath: pathValue)
fileURL.appendPathComponent(".xcodesamplecode.plist")
try! fileNakami.write(to: fileURL, atomically: true, encoding: String.Encoding.utf8)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment