This commit is contained in:
Unknown
2018-02-05 00:02:04 -05:00
parent e63a2f940b
commit eb3aa7e393
2 changed files with 14 additions and 7 deletions

14
ps.go
View File

@@ -15,16 +15,20 @@ import (
"strings"
)
const (
Cmd = "cscript.exe"
Opts = "/nologo"
)
var Cmd string
var Opts string
var pkgpath string
func init() {
_, file, _, _ := runtime.Caller(0)
pkgpath = path.Dir(file)
switch runtime.GOOS {
case "windows":
Cmd = "cscript.exe"
Opts = "/nologo"
case "darwin":
Cmd = "osacript"
}
}
// Open photoshop.

View File

@@ -4,13 +4,16 @@ import (
"fmt"
_ "io/ioutil"
"os"
"path"
"path/filepath"
_ "strings"
"testing"
)
func TestPkgPath(t *testing.T) {
fmt.Println(pkgpath)
out := filepath.Join(os.Getenv("GOPATH"), "src", "github.com", "sbrow", "ps")
if filepath.Join(pkgpath) != out {
t.Fatal(filepath.Join(pkgpath), out)
}
}
func TestOpen(t *testing.T) {