Skip to content

Commit

Permalink
readme edit
Browse files Browse the repository at this point in the history
  • Loading branch information
kevin-funderburg committed Aug 27, 2020
1 parent 6c0495f commit 2239ab4
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions BetterTouchTool/get-git-status.applescript
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,15 @@ set gitStatus to do shell script "sh " & shellPath & space & quoted form of curr

if gitStatus "false" then
set statSymbols to getStatusSymbols(gitStatus)

tell symbolsTrig
rename(statSymbols)
_font()'s setColor("red")
button()'s setColor("black")
button()'s setVisible(true)
update()
end tell

else
hideSymbolsTrig()
end if
Expand All @@ -71,18 +71,18 @@ return branch


on getStatusSymbols(gitStatus)

set branch to paragraph 1 of gitStatus
set stream to paragraph 2 of gitStatus

set statSymbols to ""

if stream = "ahead" then
set statSymbols to ""
else if stream = "behind" then
set statSymbols to ""
end if

if (count of paragraphs of gitStatus) > 2 then
set hash to {m:0, R:0, d:0, u:0}
repeat with p in (paragraphs 3 thru -1 of gitStatus)
Expand All @@ -96,13 +96,13 @@ on getStatusSymbols(gitStatus)
if hash's R 0 then set statSymbols to statSymbols & "»"
if hash's u 0 then set statSymbols to statSymbols & "?"
end if

if statSymbols "" then set statSymbols to "[" & statSymbols & "]"

set lastStatSymbols to statSymbols

return statSymbols

end getStatusSymbols

on makeNewName(_path)
Expand Down Expand Up @@ -146,4 +146,3 @@ on hideSymbolsTrig()
end tell
set branch to ""
end hideSymbolsTrig

0 comments on commit 2239ab4

Please sign in to comment.