Add stub android implementation.
This commit is contained in:
parent
5e2898f553
commit
c9f3733aee
1
.gitignore
vendored
1
.gitignore
vendored
|
@ -1 +1,2 @@
|
||||||
hrm
|
hrm
|
||||||
|
*.apk
|
||||||
|
|
2
go.mod
2
go.mod
|
@ -4,6 +4,6 @@ go 1.13
|
||||||
|
|
||||||
require (
|
require (
|
||||||
gioui.org v0.0.0-20191028123051-439d3e652c8f
|
gioui.org v0.0.0-20191028123051-439d3e652c8f
|
||||||
git.wow.st/gmp/ble v0.0.0-20191028152114-c911bbb547bc
|
git.wow.st/gmp/ble v0.0.0-20191028164333-f036c5e1346f
|
||||||
gopkg.in/yaml.v2 v2.2.4
|
gopkg.in/yaml.v2 v2.2.4
|
||||||
)
|
)
|
||||||
|
|
2
go.sum
2
go.sum
|
@ -11,6 +11,8 @@ git.wow.st/gmp/ble v0.0.0-20191028132523-2d4f106dd76c h1:GUCh9nytD5hEqw8B5/vXtY8
|
||||||
git.wow.st/gmp/ble v0.0.0-20191028132523-2d4f106dd76c/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
git.wow.st/gmp/ble v0.0.0-20191028132523-2d4f106dd76c/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
||||||
git.wow.st/gmp/ble v0.0.0-20191028152114-c911bbb547bc h1:wh2wjBt1/b+pH9PPP2TJZzv8HjpwsN0t+rN6dRwAfvY=
|
git.wow.st/gmp/ble v0.0.0-20191028152114-c911bbb547bc h1:wh2wjBt1/b+pH9PPP2TJZzv8HjpwsN0t+rN6dRwAfvY=
|
||||||
git.wow.st/gmp/ble v0.0.0-20191028152114-c911bbb547bc/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
git.wow.st/gmp/ble v0.0.0-20191028152114-c911bbb547bc/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
||||||
|
git.wow.st/gmp/ble v0.0.0-20191028164333-f036c5e1346f h1:QcNTjwSAe+/+2jdeeKx3EjS3CPv4Ur8AVrVlFfMquck=
|
||||||
|
git.wow.st/gmp/ble v0.0.0-20191028164333-f036c5e1346f/go.mod h1:MiidWVofL6FTtRokC5JGBdVUhKyvZtnia5noj08r944=
|
||||||
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
github.com/BurntSushi/xgb v0.0.0-20160522181843-27f122750802/go.mod h1:IVnqGOEym/WlBOVXweHU+Q+/VP0lqqI8lqeDx9IjBqo=
|
||||||
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
github.com/go-gl/glfw v0.0.0-20190409004039-e6da0acd62b1/go.mod h1:vR7hzQXu2zJy9AVAgeJqvqgH9Q5CA+iKCZ2gyEVpxRU=
|
||||||
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
golang.org/x/crypto v0.0.0-20190308221718-c2843e01d9a2/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
|
||||||
|
|
2
main.go
2
main.go
|
@ -31,7 +31,7 @@ var Config conf
|
||||||
var conffile string
|
var conffile string
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
conffile = path.Join(confDir, "config.yml")
|
conffile = path.Join(getConfDir(), "config.yml")
|
||||||
if _, err := os.Stat(conffile); os.IsNotExist(err) {
|
if _, err := os.Stat(conffile); os.IsNotExist(err) {
|
||||||
fd, err := os.Create(conffile)
|
fd, err := os.Create(conffile)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
|
|
15
os_android.go
Normal file
15
os_android.go
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
package main
|
||||||
|
|
||||||
|
import (
|
||||||
|
"gioui.org/app"
|
||||||
|
)
|
||||||
|
|
||||||
|
var confDir string
|
||||||
|
|
||||||
|
func getConfDir() string {
|
||||||
|
if confDir != "" {
|
||||||
|
return confDir
|
||||||
|
}
|
||||||
|
confDir,_ = app.DataDir()
|
||||||
|
return confDir
|
||||||
|
}
|
|
@ -9,7 +9,10 @@ import (
|
||||||
|
|
||||||
var confDir string
|
var confDir string
|
||||||
|
|
||||||
func init() {
|
func getConfDir() string {
|
||||||
|
if confDir != "" {
|
||||||
|
return confDir
|
||||||
|
}
|
||||||
usr, err := user.Current()
|
usr, err := user.Current()
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Fatal("Cannot get current user: ", err)
|
log.Fatal("Cannot get current user: ", err)
|
||||||
|
@ -23,4 +26,5 @@ func init() {
|
||||||
log.Print("Configuration directory created")
|
log.Print("Configuration directory created")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return confDir
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user