Skip to content

Commit

Permalink
fix(zbpack): fix static generate logic
Browse files Browse the repository at this point in the history
Signed-off-by: hackerchai <[email protected]>
  • Loading branch information
hackerchai committed Oct 29, 2023
1 parent 9bb7b57 commit e1a163c
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion internal/static/TransformServerless.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ func TransformServerless(image, workdir string, meta types.PlanMeta, planType ty
return err
}
} else {
err := utils.CopyFromImage(image, path.Join("/usr/share/nginx/html/static", meta["outputDir"])+"/.", path.Join(workdir, ".zeabur/output/static"))
err := utils.CopyFromImage(image, "/usr/share/nginx/html/static"+"/.", path.Join(workdir, ".zeabur/output/static"))
if err != nil {
return err
}
Expand Down
4 changes: 3 additions & 1 deletion pkg/zeaburpack/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -68,6 +68,7 @@ type BuildOptions struct {
// Build will analyze the project, determine the plan and build the image.
func Build(opt *BuildOptions) error {
wd, err := os.Getwd()
println("Working directory: " + wd)
if err != nil {
return err
}
Expand Down Expand Up @@ -186,7 +187,8 @@ func Build(opt *BuildOptions) error {
}

_ = os.RemoveAll(".zeabur")
if opt.Path != nil || *opt.Path != "" {
if wd != *opt.Path {
println("Removing .zeabur directory:" + *opt.Path + "/.zeabur")
_ = os.RemoveAll(*opt.Path + "/.zeabur")
}

Expand Down
Binary file modified zbpack
Binary file not shown.

0 comments on commit e1a163c

Please sign in to comment.