mirror of
https://github.com/sbrow/ps.git
synced 2026-02-28 03:01:43 -05:00
updates
This commit is contained in:
14
ps.go
14
ps.go
@@ -15,16 +15,20 @@ import (
|
|||||||
"strings"
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
var Cmd string
|
||||||
Cmd = "cscript.exe"
|
var Opts string
|
||||||
Opts = "/nologo"
|
|
||||||
)
|
|
||||||
|
|
||||||
var pkgpath string
|
var pkgpath string
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
_, file, _, _ := runtime.Caller(0)
|
_, file, _, _ := runtime.Caller(0)
|
||||||
pkgpath = path.Dir(file)
|
pkgpath = path.Dir(file)
|
||||||
|
switch runtime.GOOS {
|
||||||
|
case "windows":
|
||||||
|
Cmd = "cscript.exe"
|
||||||
|
Opts = "/nologo"
|
||||||
|
case "darwin":
|
||||||
|
Cmd = "osacript"
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Open photoshop.
|
// Open photoshop.
|
||||||
|
|||||||
@@ -4,13 +4,16 @@ import (
|
|||||||
"fmt"
|
"fmt"
|
||||||
_ "io/ioutil"
|
_ "io/ioutil"
|
||||||
"os"
|
"os"
|
||||||
"path"
|
"path/filepath"
|
||||||
_ "strings"
|
_ "strings"
|
||||||
"testing"
|
"testing"
|
||||||
)
|
)
|
||||||
|
|
||||||
func TestPkgPath(t *testing.T) {
|
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) {
|
func TestOpen(t *testing.T) {
|
||||||
|
|||||||
Reference in New Issue
Block a user