Skip to content

Commit

Permalink
init
Browse files Browse the repository at this point in the history
  • Loading branch information
chakery committed Nov 21, 2022
1 parent a646649 commit 1699aea
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 3 additions & 4 deletions e_cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ import (
"fmt"
"os"
"path"
"strings"
)

const (
Expand Down Expand Up @@ -52,13 +51,13 @@ func (c *ECmd) InitWithFlag() error {
if err != nil {
return err
}
if !strings.HasPrefix(c.BundlePath, "/") {
if !path.IsAbs(c.BundlePath) {
c.BundlePath = path.Join(pwd, c.BundlePath)
}
if !strings.HasPrefix(c.DistPath, "/") {
if !path.IsAbs(c.DistPath) {
c.DistPath = path.Join(pwd, c.DistPath)
}
if !strings.HasPrefix(c.OutputPath, "/") {
if !path.IsAbs(c.OutputPath) {
c.OutputPath = path.Join(pwd, c.OutputPath)
}

Expand Down
7 changes: 7 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,13 @@ func main() {
log.Fatal(err)
}

// mkdir
if _, err = os.Stat(eCmd.OutputPath); os.IsNotExist(err) {
err := os.MkdirAll(eCmd.OutputPath, 0731)
if err != nil {
log.Fatal(err)
}
}
// build zip file
zFile, err := os.Create(path.Join(eCmd.OutputPath, app.OutputZipFileName()))
if err != nil {
Expand Down

0 comments on commit 1699aea

Please sign in to comment.