mirror of
https://github.com/denoland/deno.git
synced 2024-11-21 15:04:11 -05:00
parent
0132a4d11d
commit
1e5b25091c
3 changed files with 5 additions and 4 deletions
|
@ -87,7 +87,7 @@ func LoadOutputCodeCache(filename string, sourceCodeBuf []byte) (
|
|||
|
||||
func UserHomeDir() string {
|
||||
if runtime.GOOS == "windows" {
|
||||
home := os.Getenv("HOMEDRIVE") + os.Getenv("HOMEPATH")
|
||||
home := path.Join(os.Getenv("HOMEDRIVE"), os.Getenv("HOMEPATH"))
|
||||
if home == "" {
|
||||
home = os.Getenv("USERPROFILE")
|
||||
}
|
||||
|
|
5
main.go
5
main.go
|
@ -6,6 +6,7 @@ import (
|
|||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
"path"
|
||||
"runtime/pprof"
|
||||
|
||||
"github.com/ry/v8worker2"
|
||||
|
@ -38,8 +39,8 @@ func setPerms() {
|
|||
Perms.Net = *flagAllowNet
|
||||
}
|
||||
|
||||
func stringAsset(path string) string {
|
||||
data, err := Asset("dist/" + path)
|
||||
func stringAsset(filename string) string {
|
||||
data, err := Asset(path.Join("dist", filename))
|
||||
check(err)
|
||||
return string(data)
|
||||
}
|
||||
|
|
2
os.go
2
os.go
|
@ -123,7 +123,7 @@ func HandleCodeFetch(moduleSpecifier string, containingFile string) (out []byte)
|
|||
sourceCodeBuf, err = FetchRemoteSource(moduleName, filename)
|
||||
} else if strings.HasPrefix(moduleName, assetPrefix) {
|
||||
f := strings.TrimPrefix(moduleName, assetPrefix)
|
||||
sourceCodeBuf, err = Asset("dist/" + f)
|
||||
sourceCodeBuf, err = Asset(path.Join("dist", f))
|
||||
if err != nil {
|
||||
logDebug("%s Asset doesn't exist. Return without error", moduleName)
|
||||
err = nil
|
||||
|
|
Loading…
Reference in a new issue