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
33724d38
Commit
33724d38
authored
Jun 11, 2015
by
Mitchell Hashimoto
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #2209 from mitchellh/b-ignore-non-exe
ignore non-exe plugins on Windows [GH-2173]
parents
16f88667
e88fa43c
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
0 deletions
+10
-0
config.go
config.go
+10
-0
No files found.
config.go
View file @
33724d38
...
@@ -6,6 +6,7 @@ import (
...
@@ -6,6 +6,7 @@ import (
"log"
"log"
"os/exec"
"os/exec"
"path/filepath"
"path/filepath"
"runtime"
"strings"
"strings"
"github.com/mitchellh/osext"
"github.com/mitchellh/osext"
...
@@ -172,6 +173,15 @@ func (c *config) discoverSingle(glob string, m *map[string]string) error {
...
@@ -172,6 +173,15 @@ func (c *config) discoverSingle(glob string, m *map[string]string) error {
for
_
,
match
:=
range
matches
{
for
_
,
match
:=
range
matches
{
file
:=
filepath
.
Base
(
match
)
file
:=
filepath
.
Base
(
match
)
// One Windows, ignore any plugins that don't end in .exe.
// We could do a full PATHEXT parse, but this is probably good enough.
if
runtime
.
GOOS
==
"windows"
&&
strings
.
ToLower
(
filepath
.
Ext
(
file
))
!=
".exe"
{
log
.
Printf
(
"[DEBUG] Ignoring plugin match %s, no exe extension"
,
match
)
continue
}
// If the filename has a ".", trim up to there
// If the filename has a ".", trim up to there
if
idx
:=
strings
.
Index
(
file
,
"."
);
idx
>=
0
{
if
idx
:=
strings
.
Index
(
file
,
"."
);
idx
>=
0
{
file
=
file
[
:
idx
]
file
=
file
[
:
idx
]
...
...
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