remove hardcoded stdlib path

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
This commit is contained in:
Andrea Luzzardi
2021-12-01 12:03:41 -08:00
parent 5b7b1cab79
commit 337ed0d1cc
9 changed files with 21 additions and 13 deletions

View File

@@ -12,6 +12,7 @@ import (
"go.dagger.io/dagger/client"
"go.dagger.io/dagger/compiler"
"go.dagger.io/dagger/state"
"go.dagger.io/dagger/stdlib"
)
func CurrentProject(ctx context.Context) *state.Project {
@@ -90,7 +91,7 @@ func FormatValue(val *compiler.Value) string {
}
if val.LookupPath(cue.MakePath(
cue.Hid("_secret", "alpha.dagger.io/dagger"),
cue.Hid("_secret", stdlib.PackageName),
cue.Str("id"),
)).Exists() {
return "dagger.#Secret"

View File

@@ -346,7 +346,7 @@ func walkStdlib(ctx context.Context, output, format string) {
return nil
}
pkgName := fmt.Sprintf("alpha.dagger.io/%s", p)
pkgName := fmt.Sprintf("%s/%s", stdlib.ModuleName, p)
lg.Info().Str("package", pkgName).Str("format", format).Msg("generating doc")
val, err := loadCode(pkgName)
if err != nil {