Skip to content

Commit

Permalink
Update dependencies and use Go modules
Browse files Browse the repository at this point in the history
  • Loading branch information
tidwall committed Nov 17, 2019
1 parent b7183f1 commit 17aeebb
Show file tree
Hide file tree
Showing 323 changed files with 229,655 additions and 2,954 deletions.
4 changes: 4 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
.DS_Store
packages/
!cmd/*
jj
8 changes: 6 additions & 2 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,10 +1,14 @@
all:
all:
@./build.sh

clean:
@rm -f jj

install: all
@cp jj /usr/local/bin

uninstall:
@rm -f /usr/local/bin/jj

package:
@NOCOPY=1 ./build.sh package
@./build.sh package
33 changes: 6 additions & 27 deletions build.sh
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
#!/bin/bash

# usage:
# ./build.sh # builds jj for the current system architecture
# ./build.sh package # builds jj for windows/mac/linux/freebsd

set -e

VERSION="1.2.2"
PROTECTED_MODE="no"

export GO15VENDOREXPERIMENT=1

cd $(dirname "${BASH_SOURCE[0]}")
OD="$(pwd)"
WD=$OD

package(){
echo Packaging $1 Binary
Expand Down Expand Up @@ -40,28 +40,7 @@ if [ "$1" == "package" ]; then
exit
fi

# temp directory for storing isolated environment.
TMP="$(mktemp -d -t sdb.XXXX)"
function rmtemp {
rm -rf "$TMP"
}
trap rmtemp EXIT

if [ "$NOCOPY" != "1" ]; then
# copy all files to an isloated directory.
WD="$TMP/src/github.com/tidwall/jj"
export GOPATH="$TMP"
for file in `find . -type f`; do
# TODO: use .gitignore to ignore, or possibly just use git to determine the file list.
if [[ "$file" != "." && "$file" != ./.git* && "$file" != ./jj ]]; then
mkdir -p "$WD/$(dirname "${file}")"
cp -P "$file" "$WD/$(dirname "${file}")"
fi
done
cd $WD
fi


# build and store objects into original directory.
go build -ldflags "-X main.version=$VERSION" -o "$OD/jj" cmd/jj/*.go
go build -ldflags "-X main.version=$VERSION" -o jj cmd/jj/*.go

10 changes: 10 additions & 0 deletions go.mod
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
module github.com/tidwall/jj

go 1.13

require (
github.com/mattn/go-isatty v0.0.10
github.com/tidwall/gjson v1.3.4
github.com/tidwall/pretty v1.0.0
github.com/tidwall/sjson v1.0.4
)
12 changes: 12 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
github.com/mattn/go-isatty v0.0.10 h1:qxFzApOv4WsAL965uUPIsXzAKCZxN2p9UqdhFS4ZW10=
github.com/mattn/go-isatty v0.0.10/go.mod h1:qgIWMr58cqv1PHHyhnkY9lrL7etaEgOFcMEpPG5Rm84=
github.com/tidwall/gjson v1.3.4 h1:On5waDnyKKk3SWE4EthbjjirAWXp43xx5cKCUZY1eZw=
github.com/tidwall/gjson v1.3.4/go.mod h1:P256ACg0Mn+j1RXIDXoss50DeIABTYK1PULOJHhxOls=
github.com/tidwall/match v1.0.1 h1:PnKP62LPNxHKTwvHHZZzdOAOCtsJTjo6dZLCwpKm5xc=
github.com/tidwall/match v1.0.1/go.mod h1:LujAq0jyVjBy028G1WhWfIzbpQfMO8bBZ6Tyb0+pL9E=
github.com/tidwall/pretty v1.0.0 h1:HsD+QiTn7sK6flMKIvNmpqz1qrpP3Ps6jOKIKMooyg4=
github.com/tidwall/pretty v1.0.0/go.mod h1:XNkn88O1ChpSDQmQeStsy+sBenx6DDtFZJxhVysOjyk=
github.com/tidwall/sjson v1.0.4 h1:UcdIRXff12Lpnu3OLtZvnc03g4vH2suXDXhBwBqmzYg=
github.com/tidwall/sjson v1.0.4/go.mod h1:bURseu1nuBkFpIES5cz6zBtjmYeOQmEESshn7VpF15Y=
golang.org/x/sys v0.0.0-20191008105621-543471e840be h1:QAcqgptGM8IQBC9K/RC4o+O9YmqEm0diQn9QmZw/0mU=
golang.org/x/sys v0.0.0-20191008105621-543471e840be/go.mod h1:h1NjWce9XRLGQEsW7wpKNCjG9DtNlClVuFLEZdDNbEs=
4 changes: 4 additions & 0 deletions vendor/github.com/mattn/go-isatty/.travis.yml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

18 changes: 0 additions & 18 deletions vendor/github.com/mattn/go-isatty/example_test.go

This file was deleted.

5 changes: 5 additions & 0 deletions vendor/github.com/mattn/go-isatty/go.mod

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 4 additions & 0 deletions vendor/github.com/mattn/go-isatty/go.sum

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 0 additions & 15 deletions vendor/github.com/mattn/go-isatty/isatty_appengine.go

This file was deleted.

6 changes: 6 additions & 0 deletions vendor/github.com/mattn/go-isatty/isatty_bsd.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions vendor/github.com/mattn/go-isatty/isatty_linux_ppc64x.go

This file was deleted.

9 changes: 7 additions & 2 deletions vendor/github.com/mattn/go-isatty/isatty_others.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 0 additions & 19 deletions vendor/github.com/mattn/go-isatty/isatty_others_test.go

This file was deleted.

22 changes: 22 additions & 0 deletions vendor/github.com/mattn/go-isatty/isatty_plan9.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 6 additions & 0 deletions vendor/github.com/mattn/go-isatty/isatty_solaris.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

19 changes: 19 additions & 0 deletions vendor/github.com/mattn/go-isatty/isatty_tcgets.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

39 changes: 35 additions & 4 deletions vendor/github.com/mattn/go-isatty/isatty_windows.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading

0 comments on commit 17aeebb

Please sign in to comment.