summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--deno_dir.go8
-rw-r--r--integration_test.go2
-rw-r--r--main.go2
3 files changed, 7 insertions, 5 deletions
diff --git a/deno_dir.go b/deno_dir.go
index 49d1e0696..60378f689 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 4c525544c..f1a60f499 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 c7b92f17e..d557ab204 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)