Update CI script
This commit is contained in:
parent
46712e512c
commit
7379d02282
3 changed files with 31 additions and 10 deletions
|
@ -1,8 +1,26 @@
|
|||
image: golang:latest
|
||||
|
||||
stages:
|
||||
- test
|
||||
- validate
|
||||
|
||||
fmt:
|
||||
stage: validate
|
||||
script:
|
||||
- gofmt -l -s -e .
|
||||
- exit $(gofmt -l -s -e . | wc -l)
|
||||
|
||||
lint:
|
||||
stage: validate
|
||||
script:
|
||||
- go get -u golang.org/x/lint/golint
|
||||
- golint -set_exit_status
|
||||
|
||||
vet:
|
||||
stage: validate
|
||||
script:
|
||||
- go vet -composites=false ./...
|
||||
|
||||
test:
|
||||
image: golang:latest
|
||||
stage: test
|
||||
stage: validate
|
||||
script:
|
||||
- go test -v ./...
|
||||
- go test -race -v ./...
|
||||
|
|
9
entry.go
9
entry.go
|
@ -13,11 +13,12 @@ import (
|
|||
// EntryType may be Application, Link or Directory.
|
||||
type EntryType int
|
||||
|
||||
// All entry types
|
||||
const (
|
||||
Unknown EntryType = iota
|
||||
Application
|
||||
Link
|
||||
Directory
|
||||
Unknown EntryType = iota // Unspecified or unrecognized
|
||||
Application // Execute command
|
||||
Link // Open browser
|
||||
Directory // Open file manager
|
||||
)
|
||||
|
||||
func (t EntryType) String() string {
|
||||
|
|
6
run.go
6
run.go
|
@ -6,7 +6,9 @@ import (
|
|||
"os"
|
||||
)
|
||||
|
||||
func RunScript(ex string) (string, error) {
|
||||
// RunScript creates a temporary run script consisting of a bash script which
|
||||
// removes itself and executes the specified command.
|
||||
func RunScript(exec string) (string, error) {
|
||||
runScript, err := ioutil.TempFile("", "run-*")
|
||||
if err != nil {
|
||||
return "", err
|
||||
|
@ -22,7 +24,7 @@ func RunScript(ex string) (string, error) {
|
|||
runScript.Close()
|
||||
return "", err
|
||||
}
|
||||
_, err = runScript.WriteString("exec " + ex + "\n")
|
||||
_, err = runScript.WriteString("exec " + exec + "\n")
|
||||
if err != nil {
|
||||
runScript.Close()
|
||||
return "", err
|
||||
|
|
Loading…
Reference in a new issue