diff --git a/deno_dir.go b/deno_dir.go index 49d1e06960..60378f6892 100644 --- a/deno_dir.go +++ b/deno_dir.go @@ -3,6 +3,7 @@ package main import ( "crypto/md5" "encoding/hex" + "flag" "io" "io/ioutil" "net/http" @@ -12,6 +13,9 @@ import ( "strings" ) +var flagCacheDir = flag.String("cachedir", "", + "Where to cache compilation artifacts. Default: ~/.deno") + var DenoDir string var CacheDir string var SrcDir string @@ -90,10 +94,10 @@ func UserHomeDir() string { } func createDirs() { - if *flagRoot == "" { + if *flagCacheDir == "" { DenoDir = path.Join(UserHomeDir(), ".deno") } else { - DenoDir = *flagRoot + DenoDir = *flagCacheDir } CacheDir = path.Join(DenoDir, "cache") err := os.MkdirAll(CacheDir, 0700) diff --git a/integration_test.go b/integration_test.go index 4c525544c4..f1a60f499d 100644 --- a/integration_test.go +++ b/integration_test.go @@ -59,7 +59,7 @@ func checkOutput(t *testing.T, outFile string, denoFn string) { panic(err) } - cmd := exec.Command(denoFn, "--root="+dir, jsFile) + cmd := exec.Command(denoFn, "--cachedir="+dir, jsFile) var out bytes.Buffer cmd.Stdout = &out err = cmd.Run() diff --git a/main.go b/main.go index c7b92f17ed..d557ab2045 100644 --- a/main.go +++ b/main.go @@ -13,8 +13,6 @@ var flagReload = flag.Bool("reload", false, "Reload cached remote source code.") var flagV8Options = flag.Bool("v8-options", false, "Print V8 command line options.") var flagDebug = flag.Bool("debug", false, "Enable debug output.") var flagGoProf = flag.String("goprof", "", "Write golang cpu profile to file.") -var flagRoot = flag.String("root", "", - "Where to cache compilation artifacts. Default: ~/.deno") func stringAsset(path string) string { data, err := Asset("dist/" + path)