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
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"encoding/json"
|
||||
"io/ioutil"
|
||||
"io"
|
||||
"path/filepath"
|
||||
"compress/gzip"
|
||||
"bytes"
|
||||
"compress/gzip"
|
||||
"crypto/sha256"
|
||||
"encoding/json"
|
||||
"fmt"
|
||||
"github.com/kr/binarydist"
|
||||
"runtime"
|
||||
"io"
|
||||
"io/ioutil"
|
||||
"os"
|
||||
"path/filepath"
|
||||
//"runtime"
|
||||
//"encoding/base64"
|
||||
)
|
||||
|
||||
const (
|
||||
plat = runtime.GOOS + "-" + runtime.GOARCH
|
||||
)
|
||||
var plat string
|
||||
|
||||
type current struct {
|
||||
Version string
|
||||
@ -61,6 +59,8 @@ func newGzReader(r io.ReadCloser) io.ReadCloser {
|
||||
}
|
||||
|
||||
func main() {
|
||||
plat = os.Getenv("GOOS") + "-" + os.Getenv("GOARCH")
|
||||
|
||||
appPath := os.Args[1]
|
||||
version := os.Args[2]
|
||||
genDir := "public"
|
||||
|
Loading…
x
Reference in New Issue
Block a user