Skip to content
This repository was archived by the owner on Jan 17, 2021. It is now read-only.

Commit b2ddce6

Browse files
author
Oren Cohen
committed
Use Code Insiders config dir if exists
1 parent cb036d8 commit b2ddce6

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

main.go

+15
Original file line numberDiff line numberDiff line change
@@ -302,24 +302,39 @@ func rsync(src string, dest string, sshFlags string, excludePaths ...string) err
302302

303303
func configDir() (string, error) {
304304
var path string
305+
var insiderPath string
305306
switch runtime.GOOS {
306307
case "linux":
307308
path = os.ExpandEnv("$HOME/.config/Code/User/")
309+
insiderPath = os.ExpandEnv("$HOME/.config/Code - Insiders/User/")
308310
case "darwin":
309311
path = os.ExpandEnv("$HOME/Library/Application Support/Code/User/")
312+
insiderPath = os.ExpandEnv("$HOME/Library/Application Support/Code - Insiders/User/")
310313
default:
311314
return "", xerrors.Errorf("unsupported platform: %s", runtime.GOOS)
312315
}
316+
317+
if pathExists(insiderPath) {
318+
return filepath.Clean(insiderPath), nil
319+
}
320+
313321
return filepath.Clean(path), nil
314322
}
315323

316324
func extensionsDir() (string, error) {
317325
var path string
326+
var insiderPath string
318327
switch runtime.GOOS {
319328
case "linux", "darwin":
320329
path = os.ExpandEnv("$HOME/.vscode/extensions/")
330+
insiderPath = os.ExpandEnv("$HOME/.vscode-insiders/extensions/")
321331
default:
322332
return "", xerrors.Errorf("unsupported platform: %s", runtime.GOOS)
323333
}
334+
335+
if pathExists(insiderPath) {
336+
return filepath.Clean(insiderPath), nil
337+
}
338+
324339
return filepath.Clean(path), nil
325340
}

0 commit comments

Comments
 (0)