mirror of
https://github.com/taigrr/go-selfupdate
synced 2025-01-18 04:33:12 -08:00
go-selfupdate binary uses os env to detect arch/platform so you can crosscompile
This commit is contained in:
parent
f1263af1c0
commit
74aa055b82
22
main.go
22
main.go
@ -1,23 +1,21 @@
|
|||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
|
||||||
"os"
|
|
||||||
"encoding/json"
|
|
||||||
"io/ioutil"
|
|
||||||
"io"
|
|
||||||
"path/filepath"
|
|
||||||
"compress/gzip"
|
|
||||||
"bytes"
|
"bytes"
|
||||||
|
"compress/gzip"
|
||||||
"crypto/sha256"
|
"crypto/sha256"
|
||||||
|
"encoding/json"
|
||||||
|
"fmt"
|
||||||
"github.com/kr/binarydist"
|
"github.com/kr/binarydist"
|
||||||
"runtime"
|
"io"
|
||||||
|
"io/ioutil"
|
||||||
|
"os"
|
||||||
|
"path/filepath"
|
||||||
|
//"runtime"
|
||||||
//"encoding/base64"
|
//"encoding/base64"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
var plat string
|
||||||
plat = runtime.GOOS + "-" + runtime.GOARCH
|
|
||||||
)
|
|
||||||
|
|
||||||
type current struct {
|
type current struct {
|
||||||
Version string
|
Version string
|
||||||
@ -61,6 +59,8 @@ func newGzReader(r io.ReadCloser) io.ReadCloser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
plat = os.Getenv("GOOS") + "-" + os.Getenv("GOARCH")
|
||||||
|
|
||||||
appPath := os.Args[1]
|
appPath := os.Args[1]
|
||||||
version := os.Args[2]
|
version := os.Args[2]
|
||||||
genDir := "public"
|
genDir := "public"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user