Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in
Toggle navigation
Open sidebar
Ijaz Ahmad
ksonnet
Commits
f45eed14
Unverified
Commit
f45eed14
authored
Aug 27, 2018
by
Sam Foo
Committed by
GitHub
Aug 27, 2018
Browse files
Merge pull request #843 from GuessWhoSamFoo/def_mod
Changed default module for import to /
parents
7284dcaa
ba115151
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 @
f45eed14
...
...
@@ -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 @
f45eed14
...
...
@@ -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 @
f45eed14
...
...
@@ -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