This repository has been archived by the owner on Apr 28, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
path compatibility fixes to improve WSL compat. (#211)
- Add `VSCODE_CONFIG_DIR` and `VSCODE_EXTENSIONS_DIR` environment variables to change the bind mounted code-server and config and extensions directories - Change the default bind mounted code-server config and extension paths on darwin - Change the code-server cache path to use os.TempDir() instead of hard-coded /tmp - Change the resolvePath() function to be compatible with shells
- Loading branch information
1 parent
e0da2f8
commit 8195b9e
Showing
4 changed files
with
43 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
package main | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
"runtime" | ||
) | ||
|
||
const ( | ||
vsCodeConfigDirEnv = "VSCODE_CONFIG_DIR" | ||
vsCodeExtensionsDirEnv = "VSCODE_EXTENSIONS_DIR" | ||
) | ||
|
||
func vscodeConfigDir() string { | ||
if env, ok := os.LookupEnv(vsCodeConfigDirEnv); ok { | ||
return os.ExpandEnv(env) | ||
} | ||
|
||
path := os.ExpandEnv("$HOME/.config/Code/") | ||
if runtime.GOOS == "darwin" { | ||
path = os.ExpandEnv("$HOME/Library/Application Support/Code/") | ||
} | ||
return filepath.Clean(path) | ||
} | ||
|
||
func vscodeExtensionsDir() string { | ||
if env, ok := os.LookupEnv(vsCodeExtensionsDirEnv); ok { | ||
return os.ExpandEnv(env) | ||
} | ||
|
||
path := os.ExpandEnv("$HOME/.vscode/extensions/") | ||
return filepath.Clean(path) | ||
} |