Refactor build (#493)

* Add lint/format checks to build
* Make travis get full repo to get tags
* Run packr2 once in cross-compile
* Fix quotes in package.json
* Fix linting issues
* Formatting
* Fix vet issue
* Fix go lint issues
* Show start of each platform compilation
* Add validate target
* Set gitattributes for go fmt and mod vendor
* Fix tag name
* Add fmt-ui target
This commit is contained in:
WithoutPants
2020-04-29 12:13:08 +10:00
committed by GitHub
parent a0306bfbd2
commit 3d22d5a742
17 changed files with 141 additions and 32 deletions

View File

@@ -2,6 +2,7 @@ package api
import (
"encoding/json"
"errors"
"fmt"
"io/ioutil"
"net/http"
@@ -18,6 +19,10 @@ const apiTags string = "https://api.github.com/repos/stashapp/stash/tags"
const apiAcceptHeader string = "application/vnd.github.v3+json"
const developmentTag string = "latest_develop"
// ErrNoVersion indicates that no version information has been embedded in the
// stash binary
var ErrNoVersion = errors.New("no stash version")
var stashReleases = func() map[string]string {
return map[string]string{
"windows/amd64": "stash-win.exe",
@@ -140,7 +145,7 @@ func GetLatestVersion(shortHash bool) (latestVersion string, latestRelease strin
version, _, _ := GetVersion()
if version == "" {
return "", "", fmt.Errorf("Stash doesn't have a version. Version check not supported.")
return "", "", ErrNoVersion
}
// if the version is suffixed with -x-xxxx, then we are running a development build