Skip to content

Commit

Permalink
Bring back support for darwin
Browse files Browse the repository at this point in the history
  • Loading branch information
aidansteele committed Sep 5, 2017
1 parent 06e0420 commit f537744
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,14 +8,14 @@ install:
- curl -sL -o glide.tgz https://github.com/Masterminds/glide/releases/download/v0.12.3/glide-v0.12.3-linux-amd64.tar.gz
- tar -xvf glide.tgz
- linux-amd64/glide install
- curl -sL -o upx.txz https://github.com/upx/upx/releases/download/v3.93/upx-3.93-amd64_linux.tar.xz
- curl -sL -o upx.txz https://github.com/upx/upx/releases/download/v3.94/upx-3.94-amd64_linux.tar.xz
- tar -xvf upx.txz

script: ls

after_success:
- CGO_ENABLED=0 gox -arch="amd64" -os="windows linux" -ldflags="-X main.ApplicationVersion=$(git describe --tags)"
- upx-3.93-amd64_linux/upx pstore_*
- CGO_ENABLED=0 gox -arch="amd64" -os="windows darwin linux" -ldflags="-X main.ApplicationVersion=$(git describe --tags)"
- upx-3.94-amd64_linux/upx pstore_*

deploy:
provider: releases
Expand All @@ -24,6 +24,7 @@ deploy:
skip_cleanup: true
file:
- pstore_linux_amd64
- pstore_darwin_amd64
- pstore_windows_amd64.exe
on:
tags: true
Expand Down
23 changes: 23 additions & 0 deletions exec_darwin.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
package main

import (
"os"
"os/exec"
"fmt"
"syscall"
)

func ExecCommand(args []string) {
if len(args) == 0 {
abort(usageError, "no command specified")
}
commandName := args[0]
commandPath, err := exec.LookPath(commandName)
if err != nil {
abort(commandNotFoundError, fmt.Sprintf("cannot find '%s'", commandName))
}
err = syscall.Exec(commandPath, args, os.Environ())
if err != nil {
abort(execError, err)
}
}

0 comments on commit f537744

Please sign in to comment.