Skip to content

Commit

Permalink
fix: package command
Browse files Browse the repository at this point in the history
  • Loading branch information
Yeuoly committed Nov 15, 2024
1 parent 244713e commit be34b65
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cmd/commandline/bundle.go
Original file line number Diff line number Diff line change
Expand Up @@ -134,7 +134,7 @@ var (
// using filename of input_path as output_path if not specified
outputPath := ""

if c.Flag("output_path") != nil {
if c.Flag("output_path").Value.String() != "" {
outputPath = c.Flag("output_path").Value.String()
} else {
base := filepath.Base(bundlePath)
Expand Down
6 changes: 4 additions & 2 deletions cmd/commandline/plugin.go
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ var (
}

pluginPackageCommand = &cobra.Command{
Use: "package plugin_path [-o output_path]",
Use: "package [plugin_path]",
Short: "Package",
Long: "Package plugins",
Args: cobra.ExactArgs(1),
Expand All @@ -29,7 +29,7 @@ var (
// using filename of input_path as output_path if not specified
outputPath := ""

if cmd.Flag("output_path") != nil {
if cmd.Flag("output_path").Value.String() != "" {
outputPath = cmd.Flag("output_path").Value.String()
} else {
base := filepath.Base(inputPath)
Expand Down Expand Up @@ -108,4 +108,6 @@ func init() {
// pluginCommand.AddCommand(pluginTestCommand)
// pluginTestCommand.Flags().StringP("inputs", "i", "", "inputs")
// pluginTestCommand.Flags().StringP("timeout", "t", "", "timeout")

pluginPackageCommand.Flags().StringP("output_path", "o", "", "output path")
}

0 comments on commit be34b65

Please sign in to comment.