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
84f8c0bf
Commit
84f8c0bf
authored
Dec 19, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
command/fix: cleaner
parent
b6795081
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
10 additions
and
8 deletions
+10
-8
command/fix/command.go
command/fix/command.go
+1
-8
command/fix/fixer.go
command/fix/fixer.go
+9
-0
No files found.
command/fix/command.go
View file @
84f8c0bf
...
@@ -49,15 +49,8 @@ func (c Command) Run(env packer.Environment, args []string) int {
...
@@ -49,15 +49,8 @@ func (c Command) Run(env packer.Environment, args []string) int {
// Close the file since we're done with that
// Close the file since we're done with that
tplF
.
Close
()
tplF
.
Close
()
// Run the template through the various fixers
fixers
:=
[]
string
{
"iso-md5"
,
"createtime"
,
"virtualbox-gaattach"
,
}
input
:=
templateData
input
:=
templateData
for
_
,
name
:=
range
fixers
{
for
_
,
name
:=
range
FixerOrder
{
var
err
error
var
err
error
fixer
,
ok
:=
Fixers
[
name
]
fixer
,
ok
:=
Fixers
[
name
]
if
!
ok
{
if
!
ok
{
...
...
command/fix/fixer.go
View file @
84f8c0bf
...
@@ -15,10 +15,19 @@ type Fixer interface {
...
@@ -15,10 +15,19 @@ type Fixer interface {
// Fixers is the map of all available fixers, by name.
// Fixers is the map of all available fixers, by name.
var
Fixers
map
[
string
]
Fixer
var
Fixers
map
[
string
]
Fixer
// FixerOrder is the default order the fixers should be run.
var
FixerOrder
[]
string
func
init
()
{
func
init
()
{
Fixers
=
map
[
string
]
Fixer
{
Fixers
=
map
[
string
]
Fixer
{
"iso-md5"
:
new
(
FixerISOMD5
),
"iso-md5"
:
new
(
FixerISOMD5
),
"createtime"
:
new
(
FixerCreateTime
),
"createtime"
:
new
(
FixerCreateTime
),
"virtualbox-gaattach"
:
new
(
FixerVirtualBoxGAAttach
),
"virtualbox-gaattach"
:
new
(
FixerVirtualBoxGAAttach
),
}
}
FixerOrder
=
[]
string
{
"iso-md5"
,
"createtime"
,
"virtualbox-gaattach"
,
}
}
}
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