Created
March 18, 2026 18:35
-
-
Save StewartLynch/194551c95e3181239262ca160c993da3 to your computer and use it in GitHub Desktop.
TUIKit Load Status Function
This file contains hidden or 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
| func loadStatus() { | |
| projectName = shell("basename \"\(launchDir)\"") | |
| branch = shell("git -C \"\(launchDir)\" rev-parse --abbrev-ref HEAD 2>/dev/null || echo '(not a git repo)'") | |
| lastCommit = shell("git -C \"\(launchDir)\" log -1 --pretty=format:'%h %s' 2>/dev/null") | |
| let raw = shell("git -C \"\(launchDir)\" status --porcelain 2>/dev/null | wc -l | tr -d ' '") | |
| changedFiles = raw.isEmpty ? "–" : raw | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment