mirror of
https://github.com/TECHNOFAB11/jsonnet-bundler.git
synced 2025-12-12 08:00:05 +01:00
Refactor git deps install and make local deps install work
This commit is contained in:
parent
07801936c0
commit
e4dcc3e116
4 changed files with 45 additions and 34 deletions
16
pkg/local.go
16
pkg/local.go
|
|
@ -17,6 +17,8 @@ package pkg
|
|||
import (
|
||||
"context"
|
||||
"fmt"
|
||||
"os"
|
||||
"path/filepath"
|
||||
|
||||
"github.com/jsonnet-bundler/jsonnet-bundler/spec"
|
||||
)
|
||||
|
|
@ -31,12 +33,16 @@ func NewLocalPackage(source *spec.LocalSource) Interface {
|
|||
}
|
||||
}
|
||||
|
||||
func (p *LocalPackage) Install(ctx context.Context, dir, version string) (lockVersion string, err error) {
|
||||
fmt.Println("SYMLINK THIS SHIT, HAHA")
|
||||
func (p *LocalPackage) Install(ctx context.Context, name, dir, version string) (lockVersion string, err error) {
|
||||
wd, err := os.Getwd()
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to get current working directory: %v", err)
|
||||
}
|
||||
|
||||
// TODO: Where do I get the name of the package?
|
||||
|
||||
fmt.Println(ctx, dir, version)
|
||||
err = os.Symlink(filepath.Join(wd, p.Source.Directory), filepath.Join(wd, dir, name))
|
||||
if err != nil {
|
||||
return "", fmt.Errorf("failed to create symlink for local dependency: %v", err)
|
||||
}
|
||||
|
||||
return "", nil
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue