Merge pull request #1085 from TomChv/feat/check-universe-version

Improve version checking to also check universe
This commit is contained in:
Sam Alba
2021-11-08 15:23:59 -08:00
committed by GitHub
4 changed files with 198 additions and 24 deletions

View File

@@ -17,7 +17,7 @@ import (
)
const (
modFilePath = "./cue.mod/dagger.mod"
ModFilePath = "./cue.mod/dagger.mod"
sumFilePath = "./cue.mod/dagger.sum"
lockFilePath = "./cue.mod/dagger.lock"
destBasePath = "./cue.mod/pkg"
@@ -31,7 +31,7 @@ type file struct {
}
func readPath(workspacePath string) (*file, error) {
pMod := path.Join(workspacePath, modFilePath)
pMod := path.Join(workspacePath, ModFilePath)
fMod, err := os.Open(pMod)
if err != nil {
if !errors.Is(err, fs.ErrNotExist) {
@@ -276,7 +276,7 @@ func (f *file) write() error {
bMod.WriteString(fmt.Sprintf("%s %s\n", r.fullPath(), r.version))
}
err := ioutil.WriteFile(path.Join(f.workspacePath, modFilePath), bMod.Bytes(), 0600)
err := ioutil.WriteFile(path.Join(f.workspacePath, ModFilePath), bMod.Bytes(), 0600)
if err != nil {
return err
}