chore: General Cleanup

This commit is contained in:
Danielle Tomlinson
2019-01-16 15:06:39 +01:00
parent f40d243cbd
commit 3287c3f019
5 changed files with 8 additions and 8 deletions

View File

@@ -255,11 +255,9 @@ func (l *PluginLoader) scan() ([]os.FileInfo, error) {
// extension and the file begins with MZ, however, there is no easy way for us to
// actually validate the executability of a file, so here we skip executability checks
// for windows systems.
if runtime.GOOS != "windows" {
if runtime.GOOS != "windows" && s.Mode().Perm()&0111 == 0 {
l.logger.Debug("skipping un-executable file in plugin folder", "file", f)
continue
}
if runtime.GOOS != "windows" && s.Mode().Perm()&0111 == 0 {
l.logger.Debug("skipping un-executable file in plugin folder", "file", f)
continue
}
plugins = append(plugins, s)
}

View File

@@ -61,7 +61,7 @@ func newHarness(t *testing.T, plugins []string) *harness {
exeSuffix = ".exe"
}
for _, p := range plugins {
dest := strings.Join([]string{filepath.Join(h.tmpDir, p), exeSuffix}, "")
dest := filepath.Join(h.tmpDir, p) + exeSuffix
if err := copyFile(selfExe, dest); err != nil {
t.Fatalf("failed to copy file: %v", err)
}