1
0
mirror of https://github.com/packwiz/packwiz.git synced 2025-05-02 10:36:31 +02:00

Add --output/-o flags for Modrinth/Curseforge export (fixes )

This commit is contained in:
comp500 2022-02-27 17:44:44 +00:00
parent 2dd0a1ae78
commit 7c387f6c83
2 changed files with 12 additions and 2 deletions
curseforge
modrinth

@ -84,7 +84,10 @@ var exportCmd = &cobra.Command{
}
}
var fileName = pack.GetPackName() + ".zip"
fileName := viper.GetString("curseforge.export.output")
if fileName == "" {
fileName = pack.GetPackName() + ".zip"
}
expFile, err := os.Create(fileName)
if err != nil {
@ -260,4 +263,6 @@ func init() {
exportCmd.Flags().StringP("side", "s", "client", "The side to export mods with")
_ = viper.BindPFlag("curseforge.export.side", exportCmd.Flags().Lookup("side"))
exportCmd.Flags().StringP("output", "o", "", "The file to export the modpack to")
_ = viper.BindPFlag("curseforge.export.output", exportCmd.Flags().Lookup("output"))
}

@ -56,7 +56,10 @@ var exportCmd = &cobra.Command{
mods := loadMods(index)
var fileName = pack.GetPackName() + ".mrpack"
fileName := viper.GetString("modrinth.export.output")
if fileName == "" {
fileName = pack.GetPackName() + ".mrpack"
}
expFile, err := os.Create(fileName)
if err != nil {
fmt.Printf("Failed to create zip: %s\n", err.Error())
@ -251,4 +254,6 @@ func loadMods(index core.Index) []core.Mod {
func init() {
modrinthCmd.AddCommand(exportCmd)
exportCmd.Flags().StringP("output", "o", "", "The file to export the modpack to")
_ = viper.BindPFlag("modrinth.export.output", exportCmd.Flags().Lookup("output"))
}