diff --git a/cmd/dagger/cmd/mod/file.go b/cmd/dagger/cmd/mod/file.go index 33be4a68..15e28a7a 100644 --- a/cmd/dagger/cmd/mod/file.go +++ b/cmd/dagger/cmd/mod/file.go @@ -12,6 +12,8 @@ import ( "strings" ) +const FilePath = "./cue.mod/dagger.mod.cue" + // A file is the parsed, interpreted form of a cue.mod file. type file struct { module string @@ -162,7 +164,7 @@ func parseGithubRepoVersion(repoSuffix string) (string, string) { } func readModFile() (*file, error) { - f, err := os.Open("./cue.mod/module.cue") + f, err := os.Open(FilePath) if err != nil { return nil, err } @@ -176,7 +178,7 @@ func readModFile() (*file, error) { } func writeModFile(f *file) error { - return ioutil.WriteFile("./cue.mod/module.cue", f.contents().Bytes(), 0600) + return ioutil.WriteFile(FilePath, f.contents().Bytes(), 0600) } func move(r *require, sourceRepoPath, destBasePath string) error { diff --git a/cmd/dagger/cmd/mod/get_test.go b/cmd/dagger/cmd/mod/get_test.go deleted file mode 100644 index d0b96e4e..00000000 --- a/cmd/dagger/cmd/mod/get_test.go +++ /dev/null @@ -1,7 +0,0 @@ -package mod - -import "testing" - -func TestUpdateModFile(t *testing.T) { - -} diff --git a/cmd/dagger/cmd/mod/repo.go b/cmd/dagger/cmd/mod/repo.go index 36630001..646db894 100644 --- a/cmd/dagger/cmd/mod/repo.go +++ b/cmd/dagger/cmd/mod/repo.go @@ -40,8 +40,8 @@ func clone(require *require, dir string) (*repo, error) { return nil, err } - if _, err := os.Stat(path.Join(dir, require.path, "cue.mod", "module.cue")); err != nil { - return nil, fmt.Errorf("repo does not contain cue.mod/module.cue") + if _, err := os.Stat(path.Join(dir, require.path, FilePath)); err != nil { + return nil, fmt.Errorf("repo does not contain %s", FilePath) } return rr, nil diff --git a/cmd/dagger/cmd/mod/repo_test.go b/cmd/dagger/cmd/mod/repo_test.go index 94078345..779dac72 100644 --- a/cmd/dagger/cmd/mod/repo_test.go +++ b/cmd/dagger/cmd/mod/repo_test.go @@ -17,7 +17,7 @@ func TestClone(t *testing.T) { prefix: "https://", repo: "github.com/tjovicic/gcpcloudrun-cue", path: "", - version: "5839b7b432b8b0c", + version: "d530f2ea2099", }, }, { @@ -35,7 +35,7 @@ func TestClone(t *testing.T) { prefix: "https://", repo: "github.com/tjovicic/gcpcloudrun-cue", path: "", - version: "v0.1", + version: "v0.3", }, }, }