-
Notifications
You must be signed in to change notification settings - Fork 19
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* account for Windows line endings * Test against mock release API * Improve input and HTTP response validation * work around mime type differences * make BinaryName platform-dependent to account for Windows * run E2E tests in CI * bump build timeout * set default missing baseURL * account for executables on Windows
- Loading branch information
1 parent
6727710
commit 9fcc92b
Showing
48 changed files
with
1,671 additions
and
154 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
//go:build !windows | ||
|
||
package fs | ||
|
||
import ( | ||
"fmt" | ||
"os" | ||
"os/exec" | ||
"path/filepath" | ||
) | ||
|
||
func lookupDirs(extraDirs []string) []string { | ||
pathVar := os.Getenv("PATH") | ||
dirs := filepath.SplitList(pathVar) | ||
for _, ep := range extraDirs { | ||
dirs = append(dirs, ep) | ||
} | ||
return dirs | ||
} | ||
|
||
func findFile(dirs []string, file string, f fileCheckFunc) (string, error) { | ||
for _, dir := range dirs { | ||
if dir == "" { | ||
// Unix shell semantics: path element "" means "." | ||
dir = "." | ||
} | ||
path := filepath.Join(dir, file) | ||
if err := f(path); err == nil { | ||
return path, nil | ||
} | ||
} | ||
return "", fmt.Errorf("%s: %w", file, exec.ErrNotFound) | ||
} | ||
|
||
func checkExecutable(file string) error { | ||
d, err := os.Stat(file) | ||
if err != nil { | ||
return err | ||
} | ||
if m := d.Mode(); !m.IsDir() && m&0111 != 0 { | ||
return nil | ||
} | ||
return os.ErrPermission | ||
} |
Oops, something went wrong.