-
Notifications
You must be signed in to change notification settings - Fork 6
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat(gen): update gen sdk * feat(jzero): update serverless design and route2code
- Loading branch information
Showing
5 changed files
with
60 additions
and
10 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
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 |
---|---|---|
|
@@ -5,9 +5,13 @@ Copyright © 2024 jaronnie <[email protected]> | |
package cmd | ||
|
||
import ( | ||
"os" | ||
"path/filepath" | ||
|
||
"github.com/spf13/cobra" | ||
|
||
"github.com/jzero-io/jzero/config" | ||
"github.com/jzero-io/jzero/embeded" | ||
"github.com/jzero-io/jzero/internal/serverless/serverlessbuild" | ||
"github.com/jzero-io/jzero/internal/serverless/serverlessdelete" | ||
"github.com/jzero-io/jzero/internal/serverless/serverlessnew" | ||
|
@@ -28,6 +32,7 @@ var serverlessNewCmd = &cobra.Command{ | |
if config.C.Serverless.New.Module == "" { | ||
config.C.Serverless.New.Module = args[0] | ||
} | ||
embeded.Home = config.C.Serverless.Home | ||
return serverlessnew.Run(args) | ||
}, | ||
Args: cobra.ExactArgs(1), | ||
|
@@ -38,6 +43,7 @@ var serverlessBuildCmd = &cobra.Command{ | |
Short: "jzero serverless build", | ||
Long: `jzero serverless build.`, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
embeded.Home = config.C.Serverless.Home | ||
return serverlessbuild.Run() | ||
}, | ||
} | ||
|
@@ -47,19 +53,22 @@ var serverlessDeleteCmd = &cobra.Command{ | |
Short: "jzero serverless delete", | ||
Long: `jzero serverless delete.`, | ||
RunE: func(cmd *cobra.Command, args []string) error { | ||
embeded.Home = config.C.Serverless.Home | ||
return serverlessdelete.Run() | ||
}, | ||
} | ||
|
||
func init() { | ||
wd, _ := os.Getwd() | ||
|
||
rootCmd.AddCommand(serverlessCmd) | ||
serverlessCmd.AddCommand(serverlessBuildCmd) | ||
serverlessCmd.AddCommand(serverlessDeleteCmd) | ||
serverlessCmd.AddCommand(serverlessNewCmd) | ||
|
||
serverlessCmd.PersistentFlags().StringP("home", "", filepath.Join(wd, ".template"), "set templates path") | ||
serverlessNewCmd.Flags().BoolP("core", "", false, "is core serverless") | ||
serverlessNewCmd.Flags().StringP("module", "m", "", "set go module") | ||
serverlessNewCmd.Flags().StringP("home", "", "", "set templates path") | ||
serverlessNewCmd.Flags().StringP("remote", "r", "https://github.com/jzero-io/templates", "remote templates repo") | ||
serverlessNewCmd.Flags().StringP("branch", "b", "", "remote templates repo branch") | ||
serverlessNewCmd.Flags().StringP("frame", "", "api", "use frame") | ||
|
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