mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 16:10:04 +01:00
fix LocalPackage install for relative paths
The vendor dir (here called "dir") is already joined with the CWD in installCommand(). it should not be joined again here. Also adds a logging message to show that a local package was installed.
This commit is contained in:
parent
ccd60c13eb
commit
13568d0b65
2 changed files with 6 additions and 2 deletions
|
|
@ -19,6 +19,7 @@ import (
|
|||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/fatih/color"
|
||||
"github.com/pkg/errors"
|
||||
|
||||
"github.com/jsonnet-bundler/jsonnet-bundler/spec/v1/deps"
|
||||
|
|
@ -41,7 +42,7 @@ func (p *LocalPackage) Install(ctx context.Context, name, dir, version string) (
|
|||
}
|
||||
|
||||
oldname := filepath.Join(wd, p.Source.Directory)
|
||||
newname := filepath.Join(wd, filepath.Join(dir, name))
|
||||
newname := filepath.Join(dir, name)
|
||||
|
||||
err = os.RemoveAll(newname)
|
||||
if err != nil {
|
||||
|
|
@ -58,5 +59,7 @@ func (p *LocalPackage) Install(ctx context.Context, name, dir, version string) (
|
|||
return "", errors.Wrap(err, "failed to create symlink for local dependency: %w")
|
||||
}
|
||||
|
||||
color.Magenta("LOCAL %s -> %s", name, oldname)
|
||||
|
||||
return "", nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue