Skip to content

Commit

Permalink
resolve absolute zip path
Browse files Browse the repository at this point in the history
  • Loading branch information
nothub committed Apr 2, 2024
1 parent 97d3b39 commit 34183f1
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cmd/root.go
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,13 @@ var RootCmd = &cobra.Command{
}
index, zipPath := handleArgs(input, version, serverDir, host)

zipPath, err := filepath.Abs(zipPath)
if err != nil {
log.Fatalln(err)
}

fmt.Printf("Installing %q from %q to %q\n", index.Name, zipPath, serverDir)
err := os.MkdirAll(serverDir, 0755)
err = os.MkdirAll(serverDir, 0755)
if err != nil {
log.Fatalln(err)
}
Expand Down
6 changes: 6 additions & 0 deletions cmd/update.go
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import (
"github.com/nothub/mrpack-install/update/packstate"
"github.com/spf13/cobra"
"log"
"path/filepath"
)

var (
Expand Down Expand Up @@ -60,6 +61,11 @@ var updateCmd = &cobra.Command{

index, zipPath := handleArgs(state.Slug, version, serverDir, host)

zipPath, err = filepath.Abs(zipPath)
if err != nil {
log.Fatalln(err)
}

update.Cmd(serverDir, dlThreads, dlRetries, index, zipPath, state)
},
}

0 comments on commit 34183f1

Please sign in to comment.