-
-
Save X140Yu/29e194ef8f22807ae71f51391b69668a to your computer and use it in GitHub Desktop.
每次执行 script.swift 都会检查是否需要重新编译,最后会执行编译后的 script.swiftc。
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
/*/../usr/bin/true | |
source="$0" | |
compiled="$0"c | |
if [[ "$source" -nt "$compiled" ]]; then | |
DEVELOPER_DIR=/Applications/Xcode.app/Contents/Developer xcrun swiftc -sdk /Applications/Xcode.app/Contents/Developer/Platforms/MacOSX.platform/Developer/SDKs/MacOSX10.14.sdk -g "$source" -o "$compiled" || exit | |
fi | |
"$compiled" | |
exit | |
*/ | |
print("👍") |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment