Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Menu
Open sidebar
Ijaz Ahmad
ksonnet
Commits
ba115151
Commit
ba115151
authored
Aug 27, 2018
by
GuessWhoSamFoo
Browse files
Changed default module for import to /
Signed-off-by:
GuessWhoSamFoo
<
sfoohei@gmail.com
>
parent
7284dcaa
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
6 additions
and
5 deletions
+6
-5
pkg/actions/import_test.go
pkg/actions/import_test.go
+1
-1
pkg/clicmd/import.go
pkg/clicmd/import.go
+1
-1
pkg/clicmd/import_test.go
pkg/clicmd/import_test.go
+4
-3
No files found.
pkg/actions/import_test.go
View file @
ba115151
...
...
@@ -53,7 +53,7 @@ func TestImport_http(t *testing.T) {
in
:=
map
[
string
]
interface
{}{
OptionApp
:
appMock
,
OptionModule
:
""
,
OptionModule
:
"
/
"
,
OptionPath
:
ts
.
URL
,
}
...
...
pkg/clicmd/import.go
View file @
ba115151
...
...
@@ -49,7 +49,7 @@ func newImportCmd(a app.App) *cobra.Command {
importCmd
.
Flags
()
.
StringP
(
flagFilename
,
shortFilename
,
""
,
"Filename, directory, or URL for component to import"
)
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
))
return
importCmd
...
...
pkg/clicmd/import_test.go
View file @
ba115151
...
...
@@ -24,12 +24,13 @@ import (
func
Test_importCmd
(
t
*
testing
.
T
)
{
cases
:=
[]
cmdTestCase
{
{
name
:
"import location"
,
name
:
"import location
without module
"
,
args
:
[]
string
{
"import"
,
"-f"
,
"location"
},
action
:
actionImport
,
expected
:
map
[
string
]
interface
{}{
actions
.
OptionApp
:
nil
,
actions
.
OptionPath
:
"location"
,
actions
.
OptionApp
:
nil
,
actions
.
OptionPath
:
"location"
,
actions
.
OptionModule
:
"/"
,
},
},
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment