Skip to content

Commit

Permalink
Merge pull request #33 from suzuki-shunsuke/feat/create-link-before-i…
Browse files Browse the repository at this point in the history
…nstalling

feat: create symbolic links before installing
  • Loading branch information
suzuki-shunsuke authored Aug 26, 2021
2 parents d9beacb + 4e2aee2 commit 7cdb020
Showing 1 changed file with 6 additions and 8 deletions.
14 changes: 6 additions & 8 deletions pkg/controller/install.go
Original file line number Diff line number Diff line change
Expand Up @@ -84,8 +84,13 @@ func (ctrl *Controller) installPackage(ctx context.Context, inlineRepo map[strin
return fmt.Errorf("render the asset name: %w", err)
}

for _, file := range pkgInfo.Files {
if err := ctrl.createLink(cfg, file); err != nil {
return err
}
}

pkgPath := getPkgPath(ctrl.RootDir, pkg, pkgInfo, assetName)
// check if the repository exists
logE.Debug("check if the package is already installed")
finfo, err := os.Stat(pkgPath)
if err != nil {
Expand All @@ -99,13 +104,6 @@ func (ctrl *Controller) installPackage(ctx context.Context, inlineRepo map[strin
}
}

// create a symbolic link
for _, file := range pkgInfo.Files {
if err := ctrl.createLink(cfg, file); err != nil {
return err
}
}

return nil
}

Expand Down

0 comments on commit 7cdb020

Please sign in to comment.