Skip to content

Commit

Permalink
Merge 6992b4e into 2556645
Browse files Browse the repository at this point in the history
  • Loading branch information
Songmu committed Apr 27, 2019
2 parents 2556645 + 6992b4e commit 7d65650
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
7 changes: 6 additions & 1 deletion builder.go
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ type builder struct {
workDirBase string
zipAlways bool
resources []string
projDir string
}

func (bdr *builder) build() (string, error) {
Expand Down Expand Up @@ -88,7 +89,11 @@ func (bdr *builder) build() (string, error) {
}

for _, rc := range bdr.resources {
dest := filepath.Join(workDir, filepath.Base(rc))
rel, _ := filepath.Rel(bdr.projDir, rc)
dest := filepath.Join(workDir, rel)
if err := os.MkdirAll(filepath.Dir(dest), 0755); err != nil {
return "", err
}
if err := os.Link(rc, dest); err != nil {
return "", err
}
Expand Down
1 change: 1 addition & 0 deletions goxz.go
Original file line number Diff line number Diff line change
Expand Up @@ -274,6 +274,7 @@ func (gx *goxz) builders() []*builder {
zipAlways: gx.zipAlways,
workDirBase: gx.workDir,
resources: gx.resources,
projDir: gx.projDir,
}
}
return builders
Expand Down

0 comments on commit 7d65650

Please sign in to comment.