mirror of
https://github.com/packwiz/packwiz.git
synced 2025-04-20 21:36:30 +02:00
Start export command
This commit is contained in:
parent
3a4abe0574
commit
33c93f3ac3
32
curseforge/export.go
Normal file
32
curseforge/export.go
Normal file
@ -0,0 +1,32 @@
|
||||
package curseforge
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"github.com/comp500/packwiz/core"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
// exportCmd represents the export command
|
||||
var exportCmd = &cobra.Command{
|
||||
Use: "export",
|
||||
Short: "Export the current modpack into a .zip for curseforge",
|
||||
// TODO: argument for file name
|
||||
Args: cobra.NoArgs,
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
fmt.Println("Loading modpack...")
|
||||
pack, err := core.LoadPack()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
index, err := pack.LoadIndex()
|
||||
if err != nil {
|
||||
fmt.Println(err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
_ = index
|
||||
},
|
||||
}
|
Loading…
x
Reference in New Issue
Block a user