-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
8d12e79
commit 60566e4
Showing
32 changed files
with
416 additions
and
139 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -17,3 +17,4 @@ server | |
/bld | ||
.build | ||
/bld.exe | ||
dist |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
package version | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/HappyRedstone/SodiumPlus/builder/internal/config" | ||
"github.com/HappyRedstone/SodiumPlus/builder/internal/multiver" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var BundleCommand = CreateBundleCommand() | ||
|
||
func CreateBundleCommand() *cobra.Command { | ||
cmd := cobra.Command{ | ||
Use: "bundle [minecraft version] [loader]", | ||
Short: "Bundle a version of a multiversion pack.", | ||
Long: `Bundle a version of a multiversion pack.`, | ||
Aliases: []string{"b", "export"}, | ||
Args: cobra.MinimumNArgs(2), | ||
|
||
RunE: func(cmd *cobra.Command, args []string) error { | ||
root, err := os.Getwd() | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
cfg, err := config.GetConfig() | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
outDir, err := filepath.Abs(cfg.MultiVersion.OutDir) | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
return multiver.BundlePack(outDir, cfg, root, args[0], args[1]) | ||
}, | ||
} | ||
|
||
return &cmd | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
package version | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"path" | ||
"path/filepath" | ||
|
||
"github.com/HappyRedstone/SodiumPlus/builder/internal/config" | ||
"github.com/HappyRedstone/SodiumPlus/builder/internal/multiver" | ||
"github.com/spf13/cobra" | ||
) | ||
|
||
var BundleAllCommand = CreateBundleAllCommand() | ||
|
||
func CreateBundleAllCommand() *cobra.Command { | ||
cmd := cobra.Command{ | ||
Use: "bundle-all", | ||
Short: "Bundle all version of a multiversion pack.", | ||
Long: `Bundle all version of a multiversion pack.`, | ||
Aliases: []string{"B", "export-all"}, | ||
|
||
RunE: func(cmd *cobra.Command, args []string) error { | ||
baseRoot, err := os.Getwd() | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
root, err := filepath.Abs(baseRoot) | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
cfg, err := config.GetConfig() | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
outDir, err := filepath.Abs(cfg.MultiVersion.OutDir) | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
items, err := multiver.FindVersions(path.Join(root, cfg.MultiVersion.VersionsDir)) | ||
|
||
if err != nil { | ||
return err | ||
} | ||
|
||
for ver, loaders := range items { | ||
for _, loader := range loaders { | ||
fmt.Printf("Bundling for %s %s...\n", loader, ver) | ||
|
||
err = multiver.BundlePack(outDir, cfg, root, ver, loader) | ||
|
||
if err != nil { | ||
return err | ||
} | ||
} | ||
} | ||
|
||
return nil | ||
}, | ||
} | ||
|
||
return &cmd | ||
} |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.