1
0
Fork 0
mirror of https://github.com/denoland/deno.git synced 2024-11-24 15:19:26 -05:00

Rename --root flag to --cachedir

This commit is contained in:
Ryan Dahl 2018-05-25 12:15:48 -04:00
parent 016684a586
commit 5353e9e90f
3 changed files with 7 additions and 5 deletions

View file

@ -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)

View file

@ -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()

View file

@ -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)