Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
P
packer
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Kristopher Ruzic
packer
Commits
3857822e
Commit
3857822e
authored
Jan 19, 2014
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
packer: don't crash if arg is empty [GH-832]
parent
602ed10e
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
9 additions
and
1 deletion
+9
-1
CHANGELOG.md
CHANGELOG.md
+1
-0
packer/environment.go
packer/environment.go
+1
-1
packer/environment_test.go
packer/environment_test.go
+7
-0
No files found.
CHANGELOG.md
View file @
3857822e
...
...
@@ -2,6 +2,7 @@
BUG FIXES:
*
core: Fix crash case if blank parameters are given to Packer. [GH-832]
*
builders/docker: user variables work properly. [GH-777]
*
builder/virtualbox,vmware: iso
\_
checksum is not required if the
checksum type is "none"
...
...
packer/environment.go
View file @
3857822e
...
...
@@ -221,7 +221,7 @@ func (e *coreEnvironment) Cli(args []string) (result int, err error) {
// Trim up to the command name
for
i
,
v
:=
range
args
{
if
v
[
0
]
!=
'-'
{
if
len
(
v
)
>
0
&&
v
[
0
]
!=
'-'
{
args
=
args
[
i
:
]
break
}
...
...
packer/environment_test.go
View file @
3857822e
...
...
@@ -198,10 +198,17 @@ func TestEnvironment_Cli_CallsRun(t *testing.T) {
func
TestEnvironment_DefaultCli_Empty
(
t
*
testing
.
T
)
{
defaultEnv
:=
testEnvironment
()
// Test with no args
exitCode
,
_
:=
defaultEnv
.
Cli
([]
string
{})
if
exitCode
!=
1
{
t
.
Fatalf
(
"bad: %d"
,
exitCode
)
}
// Test with only blank args
exitCode
,
_
=
defaultEnv
.
Cli
([]
string
{
""
})
if
exitCode
!=
1
{
t
.
Fatalf
(
"bad: %d"
,
exitCode
)
}
}
func
TestEnvironment_DefaultCli_Help
(
t
*
testing
.
T
)
{
...
...
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