Skip to content

Instantly share code, notes, and snippets.

@joedf
Created January 14, 2016 16:39
Show Gist options
  • Save joedf/d0882dee0f065cbb0d82 to your computer and use it in GitHub Desktop.
Save joedf/d0882dee0f065cbb0d82 to your computer and use it in GitHub Desktop.
Open git shell directly from "GitHub for Windows" (GH4W).
#NoEnv
#NoTrayIcon
#SingleInstance, Off
EnvGet, AppData_Local, LOCALAPPDATA
if !StrLen(AppData_Local)
if InStr(p := A_AppData,"\roaming")
AppData_Local:=SubStr(p,1,-8) "\Local"
else
ExitError("Could not find 'Local AppData'.")
WrkDir:=A_MyDocuments
if FileExist(p:=WrkDir "\GitHub")
WrkDir:=p
AppRef := AppData_Local "\GitHub\GitHub.appref-ms"
;######### ENV DATA - INITIALISATION END #########
run, %AppRef% --open-shell, %WrkDir%, UseErrorLevel
if ErrorLevel
ExitError("Could not launch. Error code: " A_LastError)
ExitError(txt) {
MsgBox, 16, %A_ScriptName% Error, % txt
ExitApp
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment