Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions cmd/deploy.go
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,10 @@ func planDeploy(configs model.ConfigMap) *model.Pipeline {
for _, file := range mod.Files {
sourcePath := filepath.Join(mod.BasePath, file.Name)
targetPath := util.CleanPath(filepath.Join(mod.Target, file.Name))
targetFolder := filepath.Dir(targetPath)

// Ensure the target folder exists
pipeline.AddModule(model.NewCreateDirIfNotExistsStep(targetFolder, file.Name))

switch file.Strategy {
case model.StrategyCopy:
Expand Down
9 changes: 8 additions & 1 deletion cmd/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -195,13 +195,16 @@ func planInstall(sources []model.PackageSource, silent bool) *model.Pipeline {

for _, dep := range deps {
// find the first source that has a matching package entry for this dependency
found := false

for _, source := range sources {
packageName, ok := dep.Packages[source.Name]
if !ok {
pipeline.AddModule(model.NewLogStep(fmt.Sprintf("No package source found for dependency %s with source %s, skipping...", dep.Name, source.Name), false))
continue
}

found = true

if !silent {
pipeline.AddModule(model.NewLogStep(fmt.Sprintf("\nInstall dependency %s using source %s ", dep.Name, source.Name), false))
}
Expand All @@ -210,6 +213,10 @@ func planInstall(sources []model.PackageSource, silent bool) *model.Pipeline {
pipeline.AddModule(model.NewExecuteShellCommandStep(command, silent))
break
}

if !found {
fmt.Printf("No package source found for dependency %s. Skipping.\n", dep.Name)
}
}

return pipeline
Expand Down
2 changes: 1 addition & 1 deletion model/pipeline.go
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ func (s *CreateDirIfNotExistsStep) Apply(config PipelineConfig) error {

func (s *CreateDirIfNotExistsStep) ApplyDry(config PipelineConfig) (string, error) {
if exists, _ := util.Exists(s.path); exists {
return "Skip creation of " + s.role + " at " + s.path + " (already exists)", nil
return "", nil
}

return "Create " + s.role + " at " + s.path, nil
Expand Down