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
3fa5fa39
Commit
3fa5fa39
authored
Aug 02, 2013
by
Jason A. Beranek
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
common/config,download: gofmt fixes
parent
760f102c
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
13 deletions
+13
-13
common/config.go
common/config.go
+6
-6
common/download.go
common/download.go
+7
-7
No files found.
common/config.go
View file @
3fa5fa39
...
@@ -7,7 +7,7 @@ import (
...
@@ -7,7 +7,7 @@ import (
"net/url"
"net/url"
"os"
"os"
"path/filepath"
"path/filepath"
"runtime"
"runtime"
"sort"
"sort"
"strings"
"strings"
)
)
...
@@ -74,11 +74,11 @@ func DownloadableURL(original string) (string, error) {
...
@@ -74,11 +74,11 @@ func DownloadableURL(original string) (string, error) {
}
}
if
url
.
Scheme
==
"file"
{
if
url
.
Scheme
==
"file"
{
// For Windows absolute file paths, remove leading /
// For Windows absolute file paths, remove leading /
// prior to processing
// prior to processing
if
runtime
.
GOOS
==
"windows"
&&
url
.
Path
[
0
]
==
'/'
{
if
runtime
.
GOOS
==
"windows"
&&
url
.
Path
[
0
]
==
'/'
{
url
.
Path
=
url
.
Path
[
1
:
len
(
url
.
Path
)]
url
.
Path
=
url
.
Path
[
1
:
len
(
url
.
Path
)]
}
}
if
_
,
err
:=
os
.
Stat
(
url
.
Path
);
err
!=
nil
{
if
_
,
err
:=
os
.
Stat
(
url
.
Path
);
err
!=
nil
{
return
""
,
err
return
""
,
err
...
...
common/download.go
View file @
3fa5fa39
...
@@ -14,7 +14,7 @@ import (
...
@@ -14,7 +14,7 @@ import (
"net/http"
"net/http"
"net/url"
"net/url"
"os"
"os"
"runtime"
"runtime"
)
)
// DownloadConfig is the configuration given to instantiate a new
// DownloadConfig is the configuration given to instantiate a new
...
@@ -107,13 +107,13 @@ func (d *DownloadClient) Get() (string, error) {
...
@@ -107,13 +107,13 @@ func (d *DownloadClient) Get() (string, error) {
// Files when we don't copy the file are special cased.
// Files when we don't copy the file are special cased.
var
finalPath
string
var
finalPath
string
if
url
.
Scheme
==
"file"
&&
!
d
.
config
.
CopyFile
{
if
url
.
Scheme
==
"file"
&&
!
d
.
config
.
CopyFile
{
// Remove forward slash on absolute Windows file URLs
// Remove forward slash on absolute Windows file URLs
// Before processing
// Before processing
if
runtime
.
GOOS
==
"windows"
&&
url
.
Path
[
0
]
==
'/'
{
if
runtime
.
GOOS
==
"windows"
&&
url
.
Path
[
0
]
==
'/'
{
finalPath
=
url
.
Path
[
1
:
len
(
url
.
Path
)]
finalPath
=
url
.
Path
[
1
:
len
(
url
.
Path
)]
}
else
{
}
else
{
finalPath
=
url
.
Path
finalPath
=
url
.
Path
}
}
}
else
{
}
else
{
finalPath
=
d
.
config
.
TargetPath
finalPath
=
d
.
config
.
TargetPath
...
...
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