diff --git a/main.go b/main.go index 34d24b0..ebb0157 100644 --- a/main.go +++ b/main.go @@ -5,11 +5,11 @@ import ( "os" "github.com/eiannone/keyboard" - "github.com/skratchdot/open-golang/open" + "github.com/pkg/browser" "github.com/urfave/cli" ) -import . "github.com/tj/go-debug" +import . "github.com/visionmedia/go-debug" var debug = Debug("imgops") @@ -109,7 +109,7 @@ func cliSearch(c *cli.Context) error { if c.Bool("return") { fmt.Println(url) } else { - open.Start(url) + browser.OpenURL(url) } } } diff --git a/run b/run index 7e1468f..0b87d3b 100644 --- a/run +++ b/run @@ -2,6 +2,7 @@ export COMMIT_HASH=`git rev-parse --short @` export COMMIT_DATE=`git log -1 --pretty=format:%cI | sed -r -e 's/T.*//' -e 's/-//g'` +export BUILD_DIR="build/" function PREBUILD { go get ./... @@ -21,7 +22,7 @@ function BUILD { VERSION=${VERSION:-${CI_BUILD_TAG:-#${CI_BUILD_REF:0:6}}} echo "Version: ${VERSION:-\$VERSION is empty}" - go build -ldflags "-X main.Version=$VERSION" -o $OUT_FILE + go build -ldflags "-X main.Version=$VERSION" -o "$BUILD_DIR$OUT_FILE" } function TEST { @@ -44,8 +45,21 @@ function BUILDALL { done } +function ZIP { + cd `dirname $1` + ZIP_FILE=`basename $1 .exe`.zip + ADD_FILE=`basename $1` + 7za a -tzip $ZIP_FILE $ADD_FILE > /dev/null 2>&1 + echo SHA1: `sha1sum $ZIP_FILE` +} + +function ZIPALL { + export -f ZIP + find $BUILD_DIR -iname "*" ! -iname "*.zip" -type f -exec bash -c 'ZIP "$1"' - {} \; +} + function HELP { - echo -e "ImgOps Build Tool\nCommands: prebuild, build, test, buildall, help" + echo -e "ImgOps Build Tool\nCommands: prebuild, build, test, buildall, zipall, help" } case $1 in @@ -57,6 +71,8 @@ case $1 in TEST ;; buildall) BUILDALL ;; + zipall) + ZIPALL ;; *) HELP ;; esac diff --git a/upload.go b/upload.go index 42e0fcb..3473ce1 100644 --- a/upload.go +++ b/upload.go @@ -9,7 +9,7 @@ import ( "github.com/parnurzeal/gorequest" ) -const uploadUrl string = "https://imgops.com/upload/uploadPhoto-action.asp" +const uploadUrl string = "https://imgops.com/store" const uploadSearch string = "userUploadTempCache" const defaultTarget = "imgops"