|
|
@ -28,6 +28,7 @@ var ( |
|
|
|
branch string |
|
|
|
branch string |
|
|
|
timeout string |
|
|
|
timeout string |
|
|
|
nomod bool |
|
|
|
nomod bool |
|
|
|
|
|
|
|
moduleName string |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
func init() { |
|
|
|
func init() { |
|
|
@ -39,6 +40,7 @@ func init() { |
|
|
|
CmdNew.Flags().StringVarP(&branch, "branch", "b", branch, "repo branch") |
|
|
|
CmdNew.Flags().StringVarP(&branch, "branch", "b", branch, "repo branch") |
|
|
|
CmdNew.Flags().StringVarP(&timeout, "timeout", "t", timeout, "time out") |
|
|
|
CmdNew.Flags().StringVarP(&timeout, "timeout", "t", timeout, "time out") |
|
|
|
CmdNew.Flags().BoolVarP(&nomod, "nomod", "", nomod, "retain go mod") |
|
|
|
CmdNew.Flags().BoolVarP(&nomod, "nomod", "", nomod, "retain go mod") |
|
|
|
|
|
|
|
CmdNew.Flags().StringVarP(&moduleName, "module-name", "m", moduleName, "module name") |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
func run(_ *cobra.Command, args []string) { |
|
|
|
func run(_ *cobra.Command, args []string) { |
|
|
@ -64,9 +66,12 @@ func run(_ *cobra.Command, args []string) { |
|
|
|
} |
|
|
|
} |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
name = args[0] |
|
|
|
name = args[0] |
|
|
|
|
|
|
|
if moduleName == "" { |
|
|
|
|
|
|
|
moduleName = name |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
} |
|
|
|
projectName, workingDir := processProjectParams(name, wd) |
|
|
|
projectName, workingDir := processProjectParams(name, wd) |
|
|
|
p := &Project{Name: projectName} |
|
|
|
p := &Project{Name: projectName, ModuleName: moduleName} |
|
|
|
done := make(chan error, 1) |
|
|
|
done := make(chan error, 1) |
|
|
|
go func() { |
|
|
|
go func() { |
|
|
|
if !nomod { |
|
|
|
if !nomod { |
|
|
|