-
Notifications
You must be signed in to change notification settings - Fork 285
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
# Conflicts: # pkg/steampipeconfig/modconfig/mod_resources.go
- Loading branch information
Showing
24 changed files
with
385 additions
and
253 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
|
||
ModParseContext has LoadedDependencyMods modconfig.ModMap | ||
|
||
currently keyed by mod name - change to key by full name of locked version | ||
|
||
GetLockedModVersionConstraint() | ||
FullName() | ||
|
||
Usage | ||
|
||
1) loadModDependencies | ||
```go | ||
func loadModDependencies(mod *modconfig.Mod, parseCtx *parse.ModParseContext) error { | ||
... | ||
for _, requiredModVersion := range mod.Require.Mods { | ||
// if we have a locked version, update the required version to reflect this | ||
lockedVersion, err := parseCtx.WorkspaceLock.GetLockedModVersionConstraint(requiredModVersion, mod) | ||
if err != nil { | ||
errors = append(errors, err) | ||
continue | ||
} | ||
if lockedVersion != nil { | ||
requiredModVersion = lockedVersion | ||
} | ||
|
||
// have we already loaded a mod which satisfied this | ||
if loadedMod, ok := parseCtx.LoadedDependencyMods[requiredModVersion.Name]; ok { | ||
|
||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
package steampipeconfig | ||
|
||
import ( | ||
"fmt" | ||
"github.com/Masterminds/semver" | ||
"github.com/turbot/steampipe/pkg/steampipeconfig/modconfig" | ||
) | ||
|
||
type LoadModOption = func(mod *modconfig.Mod) | ||
|
||
func WithDependencyConfig(modDependencyName string, version *semver.Version) LoadModOption { | ||
return func(mod *modconfig.Mod) { | ||
mod.Version = version | ||
// build the ModDependencyPath from the modDependencyName and the version | ||
mod.DependencyPath = fmt.Sprintf("%s@v%s", modDependencyName, version.String()) | ||
mod.DependencyName = modDependencyName | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.