-
Notifications
You must be signed in to change notification settings - Fork 33
/
Copy pathsanity.go
51 lines (44 loc) · 1.52 KB
/
sanity.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
package main
import (
"fmt"
"os"
"path/filepath"
uc "github.com/nanoscopic/uclop/mod"
)
func sanityChecks( config *Config, cmd *uc.Cmd ) bool {
// Verify iosif has been built / exists
bridge := config.bridge
if bridge == "go-ios" {
goIosPath := config.goIosPath
goIosPath, _ = filepath.Abs( goIosPath )
if _, err := os.Stat( goIosPath ); os.IsNotExist( err ) {
fmt.Fprintf(os.Stderr,"%s does not exist. Rerun `make` to build go-ios\n",goIosPath)
return false
}
}
if bridge == "iosif" {
iosIfPath := config.iosIfPath
iosIfPath, _ = filepath.Abs( iosIfPath )
if _, err := os.Stat( iosIfPath ); os.IsNotExist( err ) {
fmt.Fprintf(os.Stderr,"%s does not exist. Rerun `make` to build iosif\n",iosIfPath)
return false
}
}
/*if config.wdaSanityCheck {
wdaPath := config.wdaPath
wdaPath, _ = filepath.Abs( "./" + wdaPath )
if _, err := os.Stat( cfaPath ); os.IsNotExist( err ) {
fmt.Fprintf(os.Stderr,"%s does not exist. Rerun `make` to build WebDriverAgent\n",wdaPath)
return false
}
}*/
if config.cfaSanityCheck {
cfaPath := config.cfaPath
cfaPath, _ = filepath.Abs( "./" + cfaPath )
if _, err := os.Stat( cfaPath ); os.IsNotExist( err ) {
fmt.Fprintf(os.Stderr,"%s does not exist. Rerun `make` to build CFAgent\n",cfaPath)
return false
}
}
return true
}