Skip to content

Commit

Permalink
Rename --root flag to --cachedir
Browse files Browse the repository at this point in the history
  • Loading branch information
ry committed May 25, 2018
1 parent 016684a commit 5353e9e
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
8 changes: 6 additions & 2 deletions deno_dir.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package main
import (
"crypto/md5"
"encoding/hex"
"flag"
"io"
"io/ioutil"
"net/http"
Expand All @@ -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
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion integration_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
2 changes: 0 additions & 2 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 5353e9e

Please sign in to comment.