FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
codercom-sshcode/settings.go at master · bsmr/codercom-sshcode · GitHub
bsmr
codercom-sshcode
Repository navigation
Code
Pull requests
Actions
Projects
Security and quality
Insights
Expand file tree
Breadcrumbs
codercom-sshcode
/
settings.go
Copy path
More file actions
More file actions
Latest commit
History
History
History
46 lines (39 loc) · 996 Bytes
Breadcrumbs
codercom-sshcode
/
settings.go
Copy path
File metadata and controls
46 lines (39 loc) · 996 Bytes
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package
main
import
(
"os"
"path/filepath"
"runtime"
"golang.org/x/xerrors"
)
const
(
vsCodeConfigDirEnv
=
"VSCODE_CONFIG_DIR"
vsCodeExtensionsDirEnv
=
"VSCODE_EXTENSIONS_DIR"
)
func
configDir
() (
string
,
error
) {
if
env
,
ok
:=
os
.
LookupEnv
(
vsCodeConfigDirEnv
);
ok
{
return
os
.
ExpandEnv
(
env
),
nil
}
var
path
string
switch
runtime
.
GOOS
{
case
"linux"
:
path
=
os
.
ExpandEnv
(
"$HOME/.config/Code/User/"
)
case
"darwin"
:
path
=
os
.
ExpandEnv
(
"$HOME/Library/Application Support/Code/User/"
)
default
:
return
""
,
xerrors
.
Errorf
(
"unsupported platform: %s"
,
runtime
.
GOOS
)
}
return
filepath
.
Clean
(
path
),
nil
}
func
extensionsDir
() (
string
,
error
) {
if
env
,
ok
:=
os
.
LookupEnv
(
vsCodeExtensionsDirEnv
);
ok
{
return
os
.
ExpandEnv
(
env
),
nil
}
var
path
string
switch
runtime
.
GOOS
{
case
"linux"
,
"darwin"
:
path
=
os
.
ExpandEnv
(
"$HOME/.vscode/extensions/"
)
default
:
return
""
,
xerrors
.
Errorf
(
"unsupported platform: %s"
,
runtime
.
GOOS
)
}
return
filepath
.
Clean
(
path
),
nil
}
Back
|
FazBrowse Home
|
New Git URL