1
- *! version 1.0
1
+ *! version 1.1
2
2
version 12.0
3
3
capture program drop git
4
4
program define git
@@ -34,12 +34,11 @@ syntax anything(name=gitArgs id="git command and arguments")
34
34
local rmdirCmd = " rmdir /Q /S"
35
35
}
36
36
37
- /*
38
- Make the git program dir if not there and cd to it
39
- */
40
- capture confirm file " `gitDir'"
37
+ /* Make the git program dir if not there and cd to it */
38
+ /* use /nul to deal with the directory as it would be a file (for stata) */
39
+ capture confirm file " `gitDir'/nul"
41
40
if _rc! = 0{
42
- mkdir " `gitDir'"
41
+ capture mkdir " `gitDir'"
43
42
}
44
43
qui cd " `gitDir'"
45
44
@@ -81,9 +80,9 @@ syntax anything(name=gitArgs id="git command and arguments")
81
80
82
81
/* Create the repo */
83
82
local repoDir = " `gitDir'`repoName'/"
84
- capture confirm file " `repoDir'"
83
+ capture confirm file " `repoDir'/nul "
85
84
if _rc! = 0{
86
- mkdir " `repoDir'"
85
+ capture mkdir " `repoDir'"
87
86
}
88
87
else {
89
88
/* Return to old directory */
@@ -97,9 +96,9 @@ syntax anything(name=gitArgs id="git command and arguments")
97
96
/* Copy all .ado and .sthlp files to the right directory */
98
97
local programFirstLetter = lower(substr(subinstr(" `repoName'" ," stata-" ," " ,.),1,1))
99
98
local programDir = " ../ado/plus/`programFirstLetter'/"
100
- capture confirm file " `programDir'"
99
+ capture confirm file " `programDir'/nul "
101
100
if _rc! = 0{
102
- mkdir " `programDir'"
101
+ capture mkdir " `programDir'"
103
102
}
104
103
qui cd " `repoName'"
105
104
shell `copyCmd' * .ado " `adoPlusDir'`programFirstLetter'"
@@ -144,7 +143,7 @@ syntax anything(name=gitArgs id="git command and arguments")
144
143
145
144
/* Uninstall nukes all */
146
145
if (" `gitCommand'" == " uninstall" ){
147
- capture confirm file " `repoName'"
146
+ capture confirm file " `repoName'/nul "
148
147
if _rc! = 0{
149
148
di as red " -`commandCamelCase'- not installed via -git- command"
150
149
}
0 commit comments