File tree 1 file changed +5
-9
lines changed 1 file changed +5
-9
lines changed Original file line number Diff line number Diff line change 77
77
// 22: TrimSpace the reverse buildlet's gobuildkey contents
78
78
// 23: revdial v2
79
79
// 24: removeAllIncludingReadonly
80
- const buildletVersion = 24
80
+ // 25: use removeAllIncludingReadonly for all work area cleanup
81
+ const buildletVersion = 25
81
82
82
83
func defaultListenAddr () string {
83
84
if runtime .GOOS == "darwin" {
@@ -193,12 +194,7 @@ func main() {
193
194
wdName += "-" + * reverseType
194
195
}
195
196
dir := filepath .Join (os .TempDir (), wdName )
196
- if err := os .RemoveAll (dir ); err != nil { // should be no-op
197
- log .Fatal (err )
198
- }
199
- if err := os .Mkdir (dir , 0755 ); err != nil {
200
- log .Fatal (err )
201
- }
197
+ removeAllAndMkdir (dir )
202
198
* workDir = dir
203
199
}
204
200
}
@@ -1831,10 +1827,10 @@ func initBaseUnixEnv() {
1831
1827
}
1832
1828
}
1833
1829
1834
- // removeAllAndMkdir calls os.RemoveAll and then os.Mkdir on the given
1830
+ // removeAllAndMkdir calls removeAllIncludingReadonly and then os.Mkdir on the given
1835
1831
// dir, failing the process if either step fails.
1836
1832
func removeAllAndMkdir (dir string ) {
1837
- if err := os . RemoveAll (dir ); err != nil {
1833
+ if err := removeAllIncludingReadonly (dir ); err != nil {
1838
1834
log .Fatal (err )
1839
1835
}
1840
1836
if err := os .Mkdir (dir , 0755 ); err != nil {
You can’t perform that action at this time.
0 commit comments