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
9e01b5a4
Commit
9e01b5a4
authored
Aug 15, 2013
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common: detect drive letter with windows file URLs [GH-284]
parent
359f639e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
0 deletions
+11
-0
CHANGELOG.md
CHANGELOG.md
+2
-0
common/config.go
common/config.go
+9
-0
No files found.
CHANGELOG.md
View file @
9e01b5a4
...
...
@@ -27,6 +27,8 @@ IMPROVEMENTS:
BUG FIXES:
*
windows: file URLs are easier to get right as Packer
has better parsing and error handling for Windows file paths. [GH-284]
*
builder/amazon-instance: send IAM instance profile data. [GH-294]
*
builder/virtualbox: dowload progress won't be shown until download
actually starts. [GH-288]
...
...
common/config.go
View file @
9e01b5a4
...
...
@@ -64,6 +64,15 @@ func DecodeConfig(target interface{}, raws ...interface{}) (*mapstructure.Metada
// a completely valid URL. For example, the original URL might be "local/file.iso"
// which isn't a valid URL. DownloadableURL will return "file:///local/file.iso"
func
DownloadableURL
(
original
string
)
(
string
,
error
)
{
if
runtime
.
GOOS
==
"windows"
{
// If the distance to the first ":" is just one character, assume
// we're dealing with a drive letter and thus a file path.
idx
:=
strings
.
Index
(
original
,
":"
)
if
idx
==
1
{
original
=
"file:///"
+
original
}
}
url
,
err
:=
url
.
Parse
(
original
)
if
err
!=
nil
{
return
""
,
err
...
...
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