diff --git a/CHANGELOG.md b/CHANGELOG.md index 002d5925..27081bb0 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -139,6 +139,12 @@ The following log documents the history of the server project. The following log documentes the history of the CLI project +### 0.11.0 - 2020-02-05 + +#### Added + +- Allow to pass credentials through flags while logging in (#403) + ### 0.10.0 - 2019-09-30 #### Removed diff --git a/install.sh b/install.sh index 18460066..e5cac6f7 100755 --- a/install.sh +++ b/install.sh @@ -2,7 +2,7 @@ # # This script installs Dnote into your PATH (/usr/bin/local) # Use it like this: -# $ curl https://raw.githubusercontent.com/dnote/dnote/master/cli/install.sh | sh +# $ curl https://raw.githubusercontent.com/dnote/dnote/master/install.sh | sh # set -eu diff --git a/scripts/cli/build.sh b/scripts/cli/build.sh index d198bff9..0c3e30d1 100755 --- a/scripts/cli/build.sh +++ b/scripts/cli/build.sh @@ -3,9 +3,9 @@ # build.sh compiles dnote binary for target platforms. It is resonsible for creating # distributable files that can be released by a human or a script. # -# It can either cross-compile for different platforms using xgo, simply target a specific +# It can either cross-compile for different platforms using xgo, or simply target a specific # platform. Set GOOS and GOARCH environment variables to disable xgo and instead -# compile for a specific platform. +# compile locally for a specific platform. # # use: # ./scripts/build.sh 0.4.8 @@ -19,6 +19,11 @@ projectDir="$dir/../.." basedir="$projectDir/pkg/cli" outputDir="$projectDir/build/cli" +# xgo has issues when using modules +# https://github.com/karalabe/xgo/issues/176 +# bypass it by copying the project inside a GOPATH +goPathBasedir="$GOPATH/src/github.com/dnote/dnote" + command_exists () { command -v "$1" >/dev/null 2>&1; } @@ -36,7 +41,7 @@ if [[ $1 == v* ]]; then exit 1 fi -goVersion=1.12.x +goVersion=1.13.x get_binary_name() { platform=$1 @@ -57,7 +62,7 @@ build() { # build binary destDir="$outputDir/$platform-$arch" - ldflags="-X main.apiEndpoint=https://api.dnote.io -X main.versionTag=$version" + ldflags="-X main.apiEndpoint=https://api.getdnote.com -X main.versionTag=$version" tags="fts5" mkdir -p "$destDir" @@ -76,7 +81,9 @@ build() { -ldflags "$ldflags" \ --tags "$tags" \ --dest="$destDir" \ - "$basedir" + -x \ + -v \ + "$goPathBasedir/pkg/cli" fi binaryName=$(get_binary_name "$platform") @@ -99,7 +106,10 @@ build() { if [ -z "$GOOS" ] && [ -z "$GOARCH" ]; then # fetch tool - go get -u github.com/karalabe/xgo + go get -u github.com/dnote/xgo + + rm -rf "$GOPATH/src/github.com/dnote/dnote" + cp -R "$projectDir" "$goPathBasedir" build linux amd64 build darwin amd64