Commit ba115151 authored by GuessWhoSamFoo's avatar GuessWhoSamFoo
Browse files

Changed default module for import to /


Signed-off-by: default avatarGuessWhoSamFoo <sfoohei@gmail.com>
parent 7284dcaa
...@@ -53,7 +53,7 @@ func TestImport_http(t *testing.T) { ...@@ -53,7 +53,7 @@ func TestImport_http(t *testing.T) {
in := map[string]interface{}{ in := map[string]interface{}{
OptionApp: appMock, OptionApp: appMock,
OptionModule: "", OptionModule: "/",
OptionPath: ts.URL, OptionPath: ts.URL,
} }
......
...@@ -49,7 +49,7 @@ func newImportCmd(a app.App) *cobra.Command { ...@@ -49,7 +49,7 @@ func newImportCmd(a app.App) *cobra.Command {
importCmd.Flags().StringP(flagFilename, shortFilename, "", "Filename, directory, or URL for component to import") importCmd.Flags().StringP(flagFilename, shortFilename, "", "Filename, directory, or URL for component to import")
viper.BindPFlag(vImportFilename, importCmd.Flags().Lookup(flagFilename)) viper.BindPFlag(vImportFilename, importCmd.Flags().Lookup(flagFilename))
importCmd.Flags().String(flagModule, "", "Component module") importCmd.Flags().String(flagModule, "/", "Component module")
viper.BindPFlag(vImportModule, importCmd.Flags().Lookup(flagModule)) viper.BindPFlag(vImportModule, importCmd.Flags().Lookup(flagModule))
return importCmd return importCmd
......
...@@ -24,12 +24,13 @@ import ( ...@@ -24,12 +24,13 @@ import (
func Test_importCmd(t *testing.T) { func Test_importCmd(t *testing.T) {
cases := []cmdTestCase{ cases := []cmdTestCase{
{ {
name: "import location", name: "import location without module",
args: []string{"import", "-f", "location"}, args: []string{"import", "-f", "location"},
action: actionImport, action: actionImport,
expected: map[string]interface{}{ expected: map[string]interface{}{
actions.OptionApp: nil, actions.OptionApp: nil,
actions.OptionPath: "location", actions.OptionPath: "location",
actions.OptionModule: "/",
}, },
}, },
{ {
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment