From 596cac2ca4dc4bcefd87e33417cc47df8962c059 Mon Sep 17 00:00:00 2001 From: Chayoung You Date: Tue, 27 Feb 2018 15:10:11 +0900 Subject: [PATCH 01/47] Use master branch for Travis CI badge --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c91ec70..b90dc4d 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@

Release Software License - Travis + Travis Codecov branch Go Report Card Go Doc From f2e1cac67d0a0c100d588886c1a4fff47819fd5b Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sat, 17 Mar 2018 09:31:07 -0300 Subject: [PATCH 02/47] fix: do not hide errors --- main.go | 7 +++++++ shell/init.go | 2 +- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 814618d..b408f9a 100644 --- a/main.go +++ b/main.go @@ -4,6 +4,7 @@ import ( "bytes" "fmt" "io" + "log" "os" "path/filepath" "runtime" @@ -35,6 +36,12 @@ var ( initCmd = app.Command("init", "initializes the shell so Antibody can work as expected") ) +func init() { + log.SetOutput(os.Stderr) + log.SetPrefix("antibody: ") + log.SetFlags(0) +} + func main() { app.Author("Carlos Alexandro Becker ") app.Version("antibody version " + version) diff --git a/shell/init.go b/shell/init.go index b6b025c..f670bc0 100644 --- a/shell/init.go +++ b/shell/init.go @@ -10,7 +10,7 @@ const tmpl = `#!/usr/bin/env zsh antibody() { case "$1" in bundle) - source <( {{ . }} $@ ) 2> /dev/null || {{ . }} $@ + source <( {{ . }} $@ ) || {{ . }} $@ ;; *) {{ . }} $@ From 91eebdb9f34403ee537bbfad168c5ed10d7fdabd Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 22 Mar 2018 23:17:01 -0300 Subject: [PATCH 03/47] chore: release to freebsd as well --- goreleaser.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/goreleaser.yml b/goreleaser.yml index f097f52..0f0b241 100644 --- a/goreleaser.yml +++ b/goreleaser.yml @@ -2,6 +2,7 @@ build: goos: - linux - darwin + - freebsd goarch: - 386 - amd64 From ce93cd2fc5c58f9c63cc6edaf538f9ce3af08199 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Fri, 23 Mar 2018 00:02:58 -0300 Subject: [PATCH 04/47] Revert "chore: release to freebsd as well" This reverts commit 91eebdb9f34403ee537bbfad168c5ed10d7fdabd. --- goreleaser.yml | 1 - 1 file changed, 1 deletion(-) diff --git a/goreleaser.yml b/goreleaser.yml index 0f0b241..f097f52 100644 --- a/goreleaser.yml +++ b/goreleaser.yml @@ -2,7 +2,6 @@ build: goos: - linux - darwin - - freebsd goarch: - 386 - amd64 From f4eca608db15d2df5131b3a87bca2bf0828b81ea Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 23 Apr 2018 21:19:27 -0700 Subject: [PATCH 05/47] fix: required bundle arg closes #227 --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 814618d..13897a6 100644 --- a/main.go +++ b/main.go @@ -30,7 +30,7 @@ var ( updateCmd = app.Command("update", "updates all previously bundled bundles") homeCmd = app.Command("home", "prints where antibody is cloning the bundles") purgeCmd = app.Command("purge", "purges a bundle from your computer") - purgee = purgeCmd.Arg("bundle", "bundle to be purged").String() + purgee = purgeCmd.Arg("bundle", "bundle to be purged").Required().String() listCmd = app.Command("list", "lists all currently installed bundles").Alias("ls") initCmd = app.Command("init", "initializes the shell so Antibody can work as expected") ) From b729567213e7ccdd33759b651efa97f60814bbd3 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 23 Apr 2018 21:30:28 -0700 Subject: [PATCH 06/47] fix: goreleaser: update syntax --- goreleaser.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/goreleaser.yml b/goreleaser.yml index f097f52..db09f59 100644 --- a/goreleaser.yml +++ b/goreleaser.yml @@ -24,7 +24,7 @@ brew: description: The fastest shell plugin manager dependencies: - git -fpm: +nfpm: homepage: http://getantibody.github.io description: The fastest shell plugin manager maintainer: Carlos Alexandro Becker From 5966e58919bd16f17a6ba4d0d561189e9ea22239 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 23 Apr 2018 21:34:29 -0700 Subject: [PATCH 07/47] chore: improved travis config --- .travis.yml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/.travis.yml b/.travis.yml index 705ea06..6cc6959 100644 --- a/.travis.yml +++ b/.travis.yml @@ -6,17 +6,20 @@ install: script: make ci after_success: - bash <(curl -s https://codecov.io/bash) - - gem install fpm - - test -n "$TRAVIS_TAG" && curl -sL https://git.io/goreleaser | bash - make static deploy: - provider: pages - skip_cleanup: true - github_token: $GITHUB_TOKEN - repo: getantibody/getantibody.github.io - local_dir: ./dist/getantibody.github.io - target_branch: master - on: - master: true + - provider: pages + skip_cleanup: true + github_token: $GITHUB_TOKEN + repo: getantibody/getantibody.github.io + local_dir: ./dist/getantibody.github.io + target_branch: master + on: + master: true + - provider: script + skip_cleanup: true + script: curl -sL https://git.io/goreleaser | bash + on: + tags: true notifications: email: false From d90125ea49cdebce56f77799bdd04c6c9aebd936 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 23 Apr 2018 21:34:47 -0700 Subject: [PATCH 08/47] fix: using go 1.10 --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 6cc6959..e7bc10d 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,5 +1,5 @@ language: go -go: 1.9 +go: '1.10' install: - make setup - npm install -g prettier From e5ccb559eea9d835963a304bc1525782e5bb59e9 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 23 Apr 2018 21:38:00 -0700 Subject: [PATCH 09/47] chore: removed unused dep constraint --- Gopkg.toml | 4 ---- 1 file changed, 4 deletions(-) diff --git a/Gopkg.toml b/Gopkg.toml index a6bee6a..0786e78 100644 --- a/Gopkg.toml +++ b/Gopkg.toml @@ -14,10 +14,6 @@ branch = "master" name = "golang.org/x/crypto" -[[constraint]] - branch = "master" - name = "golang.org/x/net" - [[constraint]] branch = "master" name = "golang.org/x/sync" From 423584b6888de91e31c432006a240c762ab61efb Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 23 Apr 2018 21:50:42 -0700 Subject: [PATCH 10/47] fix: deploy --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index e7bc10d..8593d9a 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ deploy: master: true - provider: script skip_cleanup: true - script: curl -sL https://git.io/goreleaser | bash + script: curl -sL https://git.io/goreleaser | bash -- --rm-dist on: tags: true notifications: From f2de0a95ffc28a04b52567262288d33debe199e4 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Mon, 23 Apr 2018 22:01:40 -0700 Subject: [PATCH 11/47] fix: deploy --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 8593d9a..0459199 100644 --- a/.travis.yml +++ b/.travis.yml @@ -18,7 +18,7 @@ deploy: master: true - provider: script skip_cleanup: true - script: curl -sL https://git.io/goreleaser | bash -- --rm-dist + script: curl -sL https://git.io/goreleaser | bash -s -- --rm-dist on: tags: true notifications: From 758ceaee9d450f6c928409d0cf984cbcacc20910 Mon Sep 17 00:00:00 2001 From: HaoZeke Date: Tue, 8 May 2018 00:56:51 +0530 Subject: [PATCH 12/47] docs: Fix typo --- docs/300-install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/300-install.md b/docs/300-install.md index 1b5602d..1d4edeb 100644 --- a/docs/300-install.md +++ b/docs/300-install.md @@ -2,7 +2,7 @@ title: Install --- -Antibody can be installed trhough a variety of sources. +Antibody can be installed through a variety of sources. The simplest way is to run: From 54f56159c020a6418c6511287bb0185cd8f9e43f Mon Sep 17 00:00:00 2001 From: Patrick McDonald Date: Wed, 9 May 2018 13:33:59 -0400 Subject: [PATCH 13/47] docs: fix typo (missing "how") --- docs/200-compat.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/200-compat.md b/docs/200-compat.md index 5cebaa2..94987ad 100644 --- a/docs/200-compat.md +++ b/docs/200-compat.md @@ -3,7 +3,7 @@ title: Compatibility --- Since antibody started as a subset clone of antigen, one might wonder -compatible one is with another. Let's take a look. +how compatible one is with another. Let's take a look. Antibody can only `bundle` and `update` plugins. The `apply` command is not needed because running `antibody bundle` will already download and apply the From 6bf33f95915346a694cd478f285cd1387fb9d9eb Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Fri, 11 May 2018 20:23:40 -0300 Subject: [PATCH 14/47] docs: using sh instead of bash Co-authored-by: Rob Speed refs https://github.com/getantibody/getantibody.github.io/pull/5 --- docs/300-install.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/300-install.md b/docs/300-install.md index 1d4edeb..309446a 100644 --- a/docs/300-install.md +++ b/docs/300-install.md @@ -7,7 +7,7 @@ Antibody can be installed through a variety of sources. The simplest way is to run: ```sh -curl -sL git.io/antibody | bash -s +curl -sL git.io/antibody | sh -s ``` This will put the binary in `/usr/local/bin/antibody` From 794e707951b9862c699b703b0e9ad90b0075c55b Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 15 May 2018 21:13:13 -0300 Subject: [PATCH 15/47] bump: deps --- Gopkg.lock | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 6a795f1..d821024 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -2,15 +2,18 @@ [[projects]] + branch = "master" name = "github.com/alecthomas/kingpin" packages = ["."] - revision = "947dcec5ba9c011838740e680966fd7087a71d0d" - version = "v2.2.6" + revision = "a39589180ebd6bbf43076e514b55f20a95d43086" [[projects]] branch = "master" name = "github.com/alecthomas/template" - packages = [".","parse"] + packages = [ + ".", + "parse" + ] revision = "a0175ee3bccc567396460bf5acd36800cb10c49c" [[projects]] @@ -22,8 +25,8 @@ [[projects]] name = "github.com/caarlos0/gohome" packages = ["."] - revision = "677b1a663675ddb3cea3a1e232f5f0c70d39c246" - version = "v2.0" + revision = "c08fdebe2a8b9b92637a423c66ac5d4a8f4e91e8" + version = "v2.1.0" [[projects]] name = "github.com/davecgh/go-spew" @@ -46,32 +49,35 @@ [[projects]] name = "github.com/stretchr/testify" packages = ["assert"] - revision = "69483b4bd14f5845b5a1e55bca19e954e827f1d0" - version = "v1.1.4" + revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" + version = "v1.2.1" [[projects]] branch = "master" name = "golang.org/x/crypto" packages = ["ssh/terminal"] - revision = "94eea52f7b742c7cbe0b03b22f0c4c8631ece122" + revision = "1a580b3eff7814fc9b40602fd35256c63b50f491" [[projects]] branch = "master" name = "golang.org/x/net" packages = ["context"] - revision = "d866cfc389cec985d6fda2859936a575a55a3ab6" + revision = "2491c5de3490fced2f6cff376127c667efeed857" [[projects]] branch = "master" name = "golang.org/x/sync" packages = ["errgroup"] - revision = "fd80eb99c8f653c847d294a001bdf2a3a6f768f5" + revision = "1d60e4601c6fd243af51cc01ddf169918a5407ca" [[projects]] branch = "master" name = "golang.org/x/sys" - packages = ["unix","windows"] - revision = "571f7bbbe08da2a8955aed9d4db316e78630e9a3" + packages = [ + "unix", + "windows" + ] + revision = "7c87d13f8e835d2fb3a70a2912c811ed0c1d241b" [solve-meta] analyzer-name = "dep" From 5c60b1e561eff385a4ea3a52f3fdbf31c3940e18 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 15 May 2018 21:13:16 -0300 Subject: [PATCH 16/47] Revert "Revert "chore: release to freebsd as well"" This reverts commit ce93cd2fc5c58f9c63cc6edaf538f9ce3af08199. --- goreleaser.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/goreleaser.yml b/goreleaser.yml index db09f59..fe54952 100644 --- a/goreleaser.yml +++ b/goreleaser.yml @@ -2,6 +2,7 @@ build: goos: - linux - darwin + - freebsd goarch: - 386 - amd64 From 76bee2f761bd71538de4a6edc9eb43ea566f9567 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 5 Jun 2018 09:21:46 -0300 Subject: [PATCH 17/47] fix: fpath --- bundle/bundle_test.go | 3 ++- bundle/zsh.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/bundle/bundle_test.go b/bundle/bundle_test.go index ea1f879..e1ee842 100644 --- a/bundle/bundle_test.go +++ b/bundle/bundle_test.go @@ -15,7 +15,7 @@ func TestSuccessfullGitBundles(t *testing.T) { }{ { "caarlos0/jvm", - "jvm.plugin.zsh", + "jvm.plugin.zsh\nfpath+=( ", }, { "caarlos0/jvm kind:path", @@ -32,6 +32,7 @@ func TestSuccessfullGitBundles(t *testing.T) { } for _, row := range table { t.Run(row.line, func(t *testing.T) { + t.Parallel() home := home() result, err := bundle.New(home, row.line).Get() assert.Contains(t, result, row.result) diff --git a/bundle/zsh.go b/bundle/zsh.go index 2c007bb..9bc5294 100644 --- a/bundle/zsh.go +++ b/bundle/zsh.go @@ -1,6 +1,7 @@ package bundle import ( + "fmt" "path/filepath" "strings" @@ -29,7 +30,7 @@ func (bundle zshBundle) Get() (result string, err error) { for _, file := range files { lines = append(lines, "source "+file) } - + lines = append(lines, fmt.Sprintf("fpath+=( %s )", bundle.Project.Folder())) return strings.Join(lines, "\n"), err } From 22074d9e119be149f1216b7f4b4105581c3a2f27 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 5 Jun 2018 09:26:47 -0300 Subject: [PATCH 18/47] docs: prettier --- CODE_OF_CONDUCT.md | 20 ++++++++++---------- CONTRIBUTING.md | 6 +++--- README.md | 24 ++++++++++++------------ docs/410-options.md | 8 ++++---- docs/999-links.md | 6 +++--- 5 files changed, 32 insertions(+), 32 deletions(-) diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 4e79b4c..314fcf7 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -8,19 +8,19 @@ In the interest of fostering an open and welcoming environment, we as contributo Examples of behavior that contributes to creating a positive environment include: -* Using welcoming and inclusive language -* Being respectful of differing viewpoints and experiences -* Gracefully accepting constructive criticism -* Focusing on what is best for the community -* Showing empathy towards other community members +- Using welcoming and inclusive language +- Being respectful of differing viewpoints and experiences +- Gracefully accepting constructive criticism +- Focusing on what is best for the community +- Showing empathy towards other community members Examples of unacceptable behavior by participants include: -* The use of sexualized language or imagery and unwelcome sexual attention or advances -* Trolling, insulting/derogatory comments, and personal or political attacks -* Public or private harassment -* Publishing others' private information, such as a physical or electronic address, without explicit permission -* Other conduct which could reasonably be considered inappropriate in a professional setting +- The use of sexualized language or imagery and unwelcome sexual attention or advances +- Trolling, insulting/derogatory comments, and personal or political attacks +- Public or private harassment +- Publishing others' private information, such as a physical or electronic address, without explicit permission +- Other conduct which could reasonably be considered inappropriate in a professional setting ## Our Responsibilities diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 08e9f22..6ee0cf6 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -9,9 +9,9 @@ conduct](/CODE_OF_CONDUCT.md). Prerequisites are: -* Build: - * `make` - * [Go 1.8+](http://golang.org/doc/install) +- Build: + - `make` + - [Go 1.8+](http://golang.org/doc/install) Clone `antibody` from source into `$GOPATH`: diff --git a/README.md b/README.md index b90dc4d..95c7bd1 100644 --- a/README.md +++ b/README.md @@ -26,18 +26,18 @@ at https://getantibody.github.io ## In the wild -* I did this mostly for myself, so, my [dotfiles](https://github.com/caarlos0/dotfiles); -* @mkwmms' [dotfiles](https://github.com/mkwmms/dotfiles); -* @oieduardorabelo's [dotfiles](https://github.com/oieduardorabelo/dotfiles); -* @nisaacson's [dotfiles](https://github.com/nisaacson/dotfiles); -* @pragmaticivan's [dotfiles](https://github.com/pragmaticivan/dotfiles); -* @wkentaro's [dotfiles](https://github.com/wkentaro/dotfiles); -* @marceldias' [dotfiles](https://github.com/marceldiass/dotfiles); -* @davidkna's [dotfiles](https://github.com/davidkna/dotfiles); -* @sobolevn's [dotfiles](https://github.com/sobolevn/dotfiles); -* and probably [many others](https://github.com/search?q=antibody&type=Code); +- I did this mostly for myself, so, my [dotfiles](https://github.com/caarlos0/dotfiles); +- @mkwmms' [dotfiles](https://github.com/mkwmms/dotfiles); +- @oieduardorabelo's [dotfiles](https://github.com/oieduardorabelo/dotfiles); +- @nisaacson's [dotfiles](https://github.com/nisaacson/dotfiles); +- @pragmaticivan's [dotfiles](https://github.com/pragmaticivan/dotfiles); +- @wkentaro's [dotfiles](https://github.com/wkentaro/dotfiles); +- @marceldias' [dotfiles](https://github.com/marceldiass/dotfiles); +- @davidkna's [dotfiles](https://github.com/davidkna/dotfiles); +- @sobolevn's [dotfiles](https://github.com/sobolevn/dotfiles); +- and probably [many others](https://github.com/search?q=antibody&type=Code); ## Thanks -* [@pragmaticivan](https://github.com/pragmaticivan), for the logo design; -* All the amazing [contributors](https://github.com/getantibody/antibody/graphs/contributors). +- [@pragmaticivan](https://github.com/pragmaticivan), for the logo design; +- All the amazing [contributors](https://github.com/getantibody/antibody/graphs/contributors). diff --git a/docs/410-options.md b/docs/410-options.md index 86c7fe0..4a6dd7d 100644 --- a/docs/410-options.md +++ b/docs/410-options.md @@ -11,10 +11,10 @@ The `kind` annotation can be used to determine how a bundle should be treated. The default is `kind:zsh`, which will look for files that match these globs: -* `*.plugin.zsh` -* `*.zsh` -* `*.sh` -* `*.zsh-theme` +- `*.plugin.zsh` +- `*.zsh` +- `*.sh` +- `*.zsh-theme` And `source` them. diff --git a/docs/999-links.md b/docs/999-links.md index f2248bc..f23b4c9 100644 --- a/docs/999-links.md +++ b/docs/999-links.md @@ -2,9 +2,9 @@ title: Links --- -* Follow the progress on the [GitHub repository](https://github.com/getantibody/antibody) -* Follow [@caarlos0](https://twitter.com/caarlos0) on Twitter for updates -* [Contributing Guidelines](https://github.com/getantibody/antibody/blob/master/CONTRIBUTING.md) +- Follow the progress on the [GitHub repository](https://github.com/getantibody/antibody) +- Follow [@caarlos0](https://twitter.com/caarlos0) on Twitter for updates +- [Contributing Guidelines](https://github.com/getantibody/antibody/blob/master/CONTRIBUTING.md) This project adheres to the Contributor Covenant [code of conduct](https://github.com/getantibody/antibody/blob/master/CODE_OF_CONDUCT.md). From 00de97b90544ca90bc3b0e0c0ed97587a832b5d4 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 5 Jun 2018 21:12:54 -0300 Subject: [PATCH 19/47] test: fix --- antibodylib/antibody_test.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/antibodylib/antibody_test.go b/antibodylib/antibody_test.go index ac856e1..7e6b1a2 100644 --- a/antibodylib/antibody_test.go +++ b/antibodylib/antibody_test.go @@ -76,7 +76,7 @@ func TestMultipleRepositories(t *testing.T) { runtime.NumCPU(), ).Bundle() assert.NoError(t, err) - assert.Len(t, strings.Split(sh, "\n"), 16) + assert.Len(t, strings.Split(sh, "\n"), 27) } func TestHome(t *testing.T) { From 637ec72521adfc101d68d38a6ee3c2bd8cd39b27 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 5 Jun 2018 21:23:07 -0300 Subject: [PATCH 20/47] chore: using golangci-lint as linter --- Makefile | 28 +++++++++++++--------------- 1 file changed, 13 insertions(+), 15 deletions(-) diff --git a/Makefile b/Makefile index c272b7b..6aea1b6 100644 --- a/Makefile +++ b/Makefile @@ -1,21 +1,24 @@ SOURCE_FILES?=./... TEST_PATTERN?=. TEST_OPTIONS?= +OS=$(shell uname -s) + +export PATH := ./bin:$(PATH) # Install all the build and lint dependencies setup: - go get -u github.com/alecthomas/gometalinter - go get -u github.com/golang/dep/cmd/dep - go get -u github.com/pierrre/gotestcover - go get -u golang.org/x/tools/cmd/cover - go get -u github.com/apex/static/cmd/static-docs - dep ensure - gometalinter --install + curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh +ifeq ($(OS), Darwin) + brew install dep +else + curl https://raw.githubusercontent.com/golang/dep/master/install.sh | sh +endif + dep ensure -vendor-only .PHONY: setup # Run all the tests test: - gotestcover $(TEST_OPTIONS) -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=60s + go test $(TEST_OPTIONS) -failfast -race -coverpkg=./... -covermode=atomic -coverprofile=coverage.txt $(SOURCE_FILES) -run $(TEST_PATTERN) -timeout=2m .PHONY: test # Run all the tests and opens the coverage report @@ -25,12 +28,12 @@ cover: test # Run all the linters lint: - gometalinter --vendor ./... + golangci-lint run --enable-all ./... find . -name '*.md' -not -wholename './vendor/*' | xargs prettier -l .PHONY: lint # Run all the tests and code checks -ci: lint test +ci: build test lint .PHONY: ci # Build a beta version @@ -63,9 +66,4 @@ static: @make static-gen .PHONY: static -# Opens the current docs on the default browser -static-open: - open dist/getantibody.github.io/index.html -.PHONY: static-open - .DEFAULT_GOAL := build From e7fef722ab39d0ece06f61dedca438588f8e0a77 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 5 Jun 2018 22:28:26 -0300 Subject: [PATCH 21/47] fix: gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 3610bb6..c6be5db 100644 --- a/.gitignore +++ b/.gitignore @@ -31,3 +31,4 @@ coverage.out vendor dist coverage.txt +antibody From d37a3f235b492c0eb9fa934dc10a968259b9240c Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 14 Jun 2018 15:53:33 -0300 Subject: [PATCH 22/47] fix: site closes #235 --- .gitmodules | 3 ++ .travis.yml | 7 +++-- Makefile | 29 ++++++++---------- www/.gitignore | 1 + www/config.toml | 11 +++++++ docs/200-compat.md => www/content/compat.md | 2 ++ docs/100-fast.md => www/content/fast.md | 2 ++ docs/300-install.md => www/content/install.md | 2 ++ docs/000-intro.md => www/content/intro.md | 2 ++ docs/999-links.md => www/content/links.md | 2 ++ docs/410-options.md => www/content/options.md | 2 ++ docs/500-update.md => www/content/update.md | 2 ++ docs/400-usage.md => www/content/usage.md | 2 ++ www/static/apple-touch-icon.png | Bin 0 -> 5512 bytes www/static/avatar.png | Bin 0 -> 11612 bytes www/static/favicon.ico | Bin 0 -> 32038 bytes www/themes/hugo-apex-theme | 1 + 17 files changed, 49 insertions(+), 19 deletions(-) create mode 100644 .gitmodules create mode 100644 www/.gitignore create mode 100644 www/config.toml rename docs/200-compat.md => www/content/compat.md (96%) rename docs/100-fast.md => www/content/fast.md (99%) rename docs/300-install.md => www/content/install.md (96%) rename docs/000-intro.md => www/content/intro.md (95%) rename docs/999-links.md => www/content/links.md (95%) rename docs/410-options.md => www/content/options.md (98%) rename docs/500-update.md => www/content/update.md (97%) rename docs/400-usage.md => www/content/usage.md (98%) create mode 100644 www/static/apple-touch-icon.png create mode 100644 www/static/avatar.png create mode 100644 www/static/favicon.ico create mode 160000 www/themes/hugo-apex-theme diff --git a/.gitmodules b/.gitmodules new file mode 100644 index 0000000..a8e553a --- /dev/null +++ b/.gitmodules @@ -0,0 +1,3 @@ +[submodule "www/themes/hugo-apex-theme"] + path = www/themes/hugo-apex-theme + url = https://github.com/caarlos0/hugo-apex-theme diff --git a/.travis.yml b/.travis.yml index 0459199..b2423c9 100644 --- a/.travis.yml +++ b/.travis.yml @@ -11,11 +11,12 @@ deploy: - provider: pages skip_cleanup: true github_token: $GITHUB_TOKEN - repo: getantibody/getantibody.github.io - local_dir: ./dist/getantibody.github.io + local_dir: www/public target_branch: master + repo: getantibody/getantibody.github.io + verbose: true on: - master: true + branch: master - provider: script skip_cleanup: true script: curl -sL https://git.io/goreleaser | bash -s -- --rm-dist diff --git a/Makefile b/Makefile index 6aea1b6..ea91c2d 100644 --- a/Makefile +++ b/Makefile @@ -7,6 +7,7 @@ export PATH := ./bin:$(PATH) # Install all the build and lint dependencies setup: + curl -sfL https://install.goreleaser.com/github.com/gohugoio/hugo.sh | sh curl -sfL https://install.goreleaser.com/github.com/golangci/golangci-lint.sh | sh ifeq ($(OS), Darwin) brew install dep @@ -47,23 +48,19 @@ fmt: find . -name '*.md' -not -wholename './vendor/*' | xargs prettier --write .PHONY: fmt -# Generates the static documentation -static-gen: - @rm -rf dist/getantibody.github.io/theme - @static-docs \ - --in docs \ - --out dist/getantibody.github.io \ - --title Antibody \ - --subtitle "The fastest shell plugin manager" \ - --google UA-68164063-1 -.PHONY: static-gen - -# Downloads and generates the static documentation +# Generate the static documentation static: - @rm -rf dist/getantibody.github.io - @mkdir -p dist - @git clone https://github.com/getantibody/getantibody.github.io.git dist/getantibody.github.io - @make static-gen + @hugo --source www .PHONY: static +serve: + @hugo server -w -s www +.PHONY: serve + +favicon: + wget -O www/static/avatar.png https://avatars2.githubusercontent.com/u/16625397 + convert www/static/avatar.png -define icon:auto-resize=64,48,32,16 www/static/favicon.ico + convert www/static/avatar.png -resize x120 www/static/apple-touch-icon.png +.PHONY: favicon + .DEFAULT_GOAL := build diff --git a/www/.gitignore b/www/.gitignore new file mode 100644 index 0000000..364fdec --- /dev/null +++ b/www/.gitignore @@ -0,0 +1 @@ +public/ diff --git a/www/config.toml b/www/config.toml new file mode 100644 index 0000000..0616429 --- /dev/null +++ b/www/config.toml @@ -0,0 +1,11 @@ +baseURL = "https://getantibody.github.io/" +languageCode = "en-us" +title = "GetAntibody" +copyright = "Made with ❤️ by GetAntibody contributors." +googleAnalytics = "UA-68164063-1" +theme = "hugo-apex-theme" +pygmentsCodeFences = true +pygmentsStyle = "dracula" + +[params] +logo = "https://avatars2.githubusercontent.com/u/16625397?v=3&s=140" diff --git a/docs/200-compat.md b/www/content/compat.md similarity index 96% rename from docs/200-compat.md rename to www/content/compat.md index 94987ad..7d5ebd2 100644 --- a/docs/200-compat.md +++ b/www/content/compat.md @@ -1,5 +1,7 @@ --- title: Compatibility +weight: 200 +menu: true --- Since antibody started as a subset clone of antigen, one might wonder diff --git a/docs/100-fast.md b/www/content/fast.md similarity index 99% rename from docs/100-fast.md rename to www/content/fast.md index 8aacff6..6746258 100644 --- a/docs/100-fast.md +++ b/www/content/fast.md @@ -1,5 +1,7 @@ --- title: How much faster? +weight: 100 +menu: true --- Let's see how much faster antibody is over antigen: diff --git a/docs/300-install.md b/www/content/install.md similarity index 96% rename from docs/300-install.md rename to www/content/install.md index 309446a..1faa277 100644 --- a/docs/300-install.md +++ b/www/content/install.md @@ -1,5 +1,7 @@ --- title: Install +weight: 300 +menu: true --- Antibody can be installed through a variety of sources. diff --git a/docs/000-intro.md b/www/content/intro.md similarity index 95% rename from docs/000-intro.md rename to www/content/intro.md index 837e41b..6296247 100644 --- a/docs/000-intro.md +++ b/www/content/intro.md @@ -1,5 +1,7 @@ --- title: Introduction +weight: 1 +menu: true --- Antibody is a shell plugin manager made from the ground up thinking about diff --git a/docs/999-links.md b/www/content/links.md similarity index 95% rename from docs/999-links.md rename to www/content/links.md index f23b4c9..6c51f30 100644 --- a/docs/999-links.md +++ b/www/content/links.md @@ -1,5 +1,7 @@ --- title: Links +weight: 999 +menu: true --- - Follow the progress on the [GitHub repository](https://github.com/getantibody/antibody) diff --git a/docs/410-options.md b/www/content/options.md similarity index 98% rename from docs/410-options.md rename to www/content/options.md index 4a6dd7d..44f35c6 100644 --- a/docs/410-options.md +++ b/www/content/options.md @@ -1,5 +1,7 @@ --- title: Options +weight: 410 +menu: true --- There are a few options you can use that should cover most common use cases. diff --git a/docs/500-update.md b/www/content/update.md similarity index 97% rename from docs/500-update.md rename to www/content/update.md index b846bc3..72998a6 100644 --- a/docs/500-update.md +++ b/www/content/update.md @@ -1,5 +1,7 @@ --- title: Outro +weight: 500 +menu: true --- Let's look what other commands antibody has available for us! diff --git a/docs/400-usage.md b/www/content/usage.md similarity index 98% rename from docs/400-usage.md rename to www/content/usage.md index 855f7cf..81284f3 100644 --- a/docs/400-usage.md +++ b/www/content/usage.md @@ -1,5 +1,7 @@ --- title: Usage +weight: 400 +menu: true --- There are mainly two ways of using antibody: static and dynamic. diff --git a/www/static/apple-touch-icon.png b/www/static/apple-touch-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..1ea0e898e9e7440eea62f6205fdc80a8819ede30 GIT binary patch literal 5512 zcmb`LcRX8P_{W2)h*`8YMJZ}TV~>v5duwf~cEzYYii)B}wN~t{1hGY8htg8DYKPi; zeATQJzx2=F@9*EauY1qyoO_>p&-pyh>;0U2;tcfEX+Ufs002Ovsi9&-tONg@z?;OY z+)L>(Vs*p$sqRw%pzZ_JUwd+5`>unAkuCrbEC2vRzyW{@Vpqf_0N@7(0JiM_0C@xe z!0eTSHB=hoI>oO@YU2+rC1^d(MkY)<7!v|0Hy>@m8T|wvwOKg z2-7c_eZP?MbJkeGsak`iCjK<@aoHR1BOXs)^cBhId>i%g#FHW{_@Io3I;AOAF(KlfQW};emQ#O>Jo8!jWI@ zYXJBEE%|wXL!(XnxNSF;XI>O*O2A!?T`Fi6?%t4mC}vNHX_YJLvyD#|VNLSf2^y1$n%Bc2=hj z-fCp7^_bG)2w&9&A6o&J>;fj(fLle#)BNXW->mbN$4tZ(4-wb6+E1>@xad6X43x+fQeE=c5E~kHJd?zsQ+ZTFV%?FRj?^~T0E7Qu=R|A{-m`= z;HJaukm?^km`pXBGLYg~j_v$}!^|E_$TDdaVHJk=5>KvWqoreMPZ$1rwa&?8!FsC>@cwe{5b zm#`%}TW#Y8uxG`>#LBEF3&clk!6HBu)M^7w02ms|cgWmNLD zWv_0QUktm&{&G|t6#!oQ2AkfnI6$?nCmhR>SoHUn&{W2!E;(~$qWd?F1Wl8)YZO!* zbUG^pJ$pUsdc~}@A|HsC6BgKN7?bi6Wu|PJ^sP*XEOdbExmxDX=eDMlLrC|(8R_5$ z#wZAXB$*lsb#Ye#+%ahLS+d05B!0KBQ_o`JCiCgpm^HV=>cf8`T7_$l*H=}{&>0uy zWa&{uHxUtr;OC~s89e-v?8TO&^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mV?d00001 diff --git a/www/themes/hugo-apex-theme b/www/themes/hugo-apex-theme new file mode 160000 index 0000000..6606ec1 --- /dev/null +++ b/www/themes/hugo-apex-theme @@ -0,0 +1 @@ +Subproject commit 6606ec110965d9722e82a2726ae0d4ed32a1d011 From f01ad6d65419503c32a3b7d5ee748c30bdff18ea Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 14 Jun 2018 15:58:08 -0300 Subject: [PATCH 23/47] fix: wrong submodule --- www/themes/hugo-apex-theme | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/www/themes/hugo-apex-theme b/www/themes/hugo-apex-theme index 6606ec1..3bddc70 160000 --- a/www/themes/hugo-apex-theme +++ b/www/themes/hugo-apex-theme @@ -1 +1 @@ -Subproject commit 6606ec110965d9722e82a2726ae0d4ed32a1d011 +Subproject commit 3bddc70df07a4449d2ec853bc5ae3438d0394342 From 9dc8a1dff6fe9bee4eba1d16176a7dac527d3095 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 26 Jun 2018 11:15:01 -0300 Subject: [PATCH 24/47] docs: bump site theme --- Makefile | 4 ++-- www/themes/hugo-apex-theme | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Makefile b/Makefile index ea91c2d..e5aa257 100644 --- a/Makefile +++ b/Makefile @@ -50,11 +50,11 @@ fmt: # Generate the static documentation static: - @hugo --source www + @hugo --enableGitInfo --source www .PHONY: static serve: - @hugo server -w -s www + @hugo server --enableGitInfo --watch --source www .PHONY: serve favicon: diff --git a/www/themes/hugo-apex-theme b/www/themes/hugo-apex-theme index 3bddc70..cb87b6b 160000 --- a/www/themes/hugo-apex-theme +++ b/www/themes/hugo-apex-theme @@ -1 +1 @@ -Subproject commit 3bddc70df07a4449d2ec853bc5ae3438d0394342 +Subproject commit cb87b6b1368824d743a5d31d824eaecd2351b783 From 7a79a413f1f7f0755cd2927c3fbe0088e3e53439 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 26 Jun 2018 11:25:43 -0300 Subject: [PATCH 25/47] fix: better antibody list fixes #130 --- main.go | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/main.go b/main.go index 9c3068a..5724199 100644 --- a/main.go +++ b/main.go @@ -10,11 +10,13 @@ import ( "runtime" "strconv" "strings" + "text/tabwriter" "github.com/alecthomas/kingpin" "github.com/getantibody/antibody/antibodylib" "github.com/getantibody/antibody/project" "github.com/getantibody/antibody/shell" + "github.com/getantibody/folder" "golang.org/x/crypto/ssh/terminal" ) @@ -95,7 +97,9 @@ func list() { home := antibodylib.Home() projects, err := project.List(home) app.FatalIfError(err, "failed to list bundles") + w := tabwriter.NewWriter(os.Stdout, 0, 1, 4, ' ', tabwriter.TabIndent) for _, b := range projects { - fmt.Println(filepath.Join(home, b)) + fmt.Fprintf(w, "%s\t%s\n", folder.ToURL(b), filepath.Join(home, b)) } + w.Flush() } From d3e7a973fd2b58db03586a4171b8c427ce1ea0f6 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 26 Jun 2018 11:32:39 -0300 Subject: [PATCH 26/47] chore: linter fixes --- Makefile | 2 +- antibodylib/antibody.go | 2 +- bundle/bundle.go | 6 +++--- project/local.go | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Makefile b/Makefile index e5aa257..a37bce8 100644 --- a/Makefile +++ b/Makefile @@ -29,7 +29,7 @@ cover: test # Run all the linters lint: - golangci-lint run --enable-all ./... + ./bin/golangci-lint run --enable-all ./... find . -name '*.md' -not -wholename './vendor/*' | xargs prettier -l .PHONY: lint diff --git a/antibodylib/antibody.go b/antibodylib/antibody.go index 4fe292f..c45ff6c 100644 --- a/antibodylib/antibody.go +++ b/antibodylib/antibody.go @@ -51,7 +51,7 @@ func (a *Antibody) Bundle() (result string, err error) { } s, berr := bundle.New(a.Home, l).Get() lock.Lock() - shs = append(shs, indexedLine{index, s}) + shs = append(shs, indexedLine{idx: index, line: s}) lock.Unlock() return berr }) diff --git a/bundle/bundle.go b/bundle/bundle.go index f7d0fd4..dddb179 100644 --- a/bundle/bundle.go +++ b/bundle/bundle.go @@ -29,12 +29,12 @@ func New(home, line string) Bundle { kind := extract(line) proj := project.New(home, line) if kind == "path" { - return pathBundle{proj} + return pathBundle{Project: proj} } if kind == "dummy" { - return dummyBundle{proj} + return dummyBundle{Project: proj} } - return zshBundle{proj} + return zshBundle{Project: proj} } func extract(line string) string { diff --git a/project/local.go b/project/local.go index acc4b05..958d140 100644 --- a/project/local.go +++ b/project/local.go @@ -7,7 +7,7 @@ import ( // NewLocal Returns a local project, which can be any folder you want to func NewLocal(folder string) Project { - return localProject{strings.Split(folder, " ")[0]} + return localProject{folder: strings.Split(folder, " ")[0]} } type localProject struct { From 3a6c0938a53fae2e051f4702eb19a2308556151c Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 26 Jun 2018 11:41:13 -0300 Subject: [PATCH 27/47] fix: show which packages are being updated closes #203 --- project/git.go | 2 ++ 1 file changed, 2 insertions(+) diff --git a/project/git.go b/project/git.go index ae2e711..590545b 100644 --- a/project/git.go +++ b/project/git.go @@ -1,6 +1,7 @@ package project import ( + "fmt" "log" "os" "os/exec" @@ -90,6 +91,7 @@ func (g gitProject) Download() error { } func (g gitProject) Update() error { + fmt.Println("updating:", g.URL) // #nosec if bts, err := exec.Command( "git", "-C", g.folder, "pull", From 2db35afb7c2fb120f900a9f3bc651e65ec72a8fa Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 26 Jun 2018 11:43:16 -0300 Subject: [PATCH 28/47] docs: update list output example --- www/content/update.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/www/content/update.md b/www/content/update.md index 72998a6..1a183c4 100644 --- a/www/content/update.md +++ b/www/content/update.md @@ -35,8 +35,8 @@ course list them: ```console $ antibody list -/Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-Tarrasch-SLASH-zsh-bd -/Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-git-add-remote +https://github.com/Tarrasch/zsh-bd /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-Tarrasch-SLASH-zsh-bd +https://github.com/caarlos0/git-add-remote /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-git-add-remote # ... ``` From 11934eb1716c3512c2582399b16469833d9114c8 Mon Sep 17 00:00:00 2001 From: Vik Ramanujam Date: Thu, 5 Jul 2018 13:04:49 +0800 Subject: [PATCH 29/47] Create even-faster.md --- www/content/even-faster.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 www/content/even-faster.md diff --git a/www/content/even-faster.md b/www/content/even-faster.md new file mode 100644 index 0000000..80043e8 --- /dev/null +++ b/www/content/even-faster.md @@ -0,0 +1,7 @@ +Antibody is faster than other zsh package managers, but you might want to speed it up further. + +Highly recommended to read the following. + +Here's some useful links: + - [Speeding up my ZSH load - Carlos Alexandro Becker](https://carlosbecker.com/posts/speeding-up-zsh/): outlines a few fixes that will speed up the prompt massively. Also explains how to debug your prompt load time. + - [Speed up zsh compinit by only checking cache once a day.](https://gist.github.com/ctechols/ca1035271ad134841284): mentioned in the previous link, but leaving this here for reference as it is helpful for anyone using zsh. From 868a859b129ef2a25ec281d7471ab6d4460d7f7f Mon Sep 17 00:00:00 2001 From: Vik Ramanujam Date: Thu, 5 Jul 2018 13:12:28 +0800 Subject: [PATCH 30/47] Update even-faster.md --- www/content/even-faster.md | 1 + 1 file changed, 1 insertion(+) diff --git a/www/content/even-faster.md b/www/content/even-faster.md index 80043e8..812610d 100644 --- a/www/content/even-faster.md +++ b/www/content/even-faster.md @@ -5,3 +5,4 @@ Highly recommended to read the following. Here's some useful links: - [Speeding up my ZSH load - Carlos Alexandro Becker](https://carlosbecker.com/posts/speeding-up-zsh/): outlines a few fixes that will speed up the prompt massively. Also explains how to debug your prompt load time. - [Speed up zsh compinit by only checking cache once a day.](https://gist.github.com/ctechols/ca1035271ad134841284): mentioned in the previous link, but leaving this here for reference as it is helpful for anyone using zsh. + - [How to debug zsh startup time — JB on programming 1.0.0 documentation](http://jb-blog.readthedocs.io/en/latest/posts/0032-debugging-zsh-startup-time.html) From 170ea34d3a65edddbddf54a7ca765567b81eedd5 Mon Sep 17 00:00:00 2001 From: Mark Crichton Date: Tue, 10 Jul 2018 16:57:56 -0400 Subject: [PATCH 31/47] Set environment for git exec.Command() --- project/git.go | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/project/git.go b/project/git.go index 590545b..f24a04f 100644 --- a/project/git.go +++ b/project/git.go @@ -81,7 +81,8 @@ func (g gitProject) Download() error { "-b", g.Version, g.URL, g.folder) - cmd.Env = append(cmd.Env, "GIT_TERMINAL_PROMPT=0") + cmd.Env = append(os.Environ(), "GIT_TERMINAL_PROMPT=0") + if bts, err := cmd.CombinedOutput(); err != nil { log.Println("git clone failed for", g.URL, string(bts)) return err From 2a218463cad2685beb435c21caf92128621bea81 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 10 Jul 2018 14:15:42 -0700 Subject: [PATCH 32/47] fix: lint --- antibodylib/antibody_test.go | 1 + antibodylib/sort.go | 1 + 2 files changed, 2 insertions(+) diff --git a/antibodylib/antibody_test.go b/antibodylib/antibody_test.go index 7e6b1a2..48226be 100644 --- a/antibodylib/antibody_test.go +++ b/antibodylib/antibody_test.go @@ -36,6 +36,7 @@ func TestAntibody(t *testing.T) { assert.Contains(t, sh, `export PATH="/tmp:$PATH"`) assert.Contains(t, sh, `export PATH="`+home+`/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-ports:$PATH"`) assert.Contains(t, sh, `export PATH="`+home+`/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-jvm:$PATH"`) + // nolint: lll assert.Contains(t, sh, `source `+home+`/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-zsh-open-pr/git-open-pr.plugin.zsh`) } diff --git a/antibodylib/sort.go b/antibodylib/sort.go index ed36989..a22dff9 100644 --- a/antibodylib/sort.go +++ b/antibodylib/sort.go @@ -30,6 +30,7 @@ func (slice indexedLines) Swap(i, j int) { // Sort all lines and join them in a string func (slice indexedLines) String() string { sort.Sort(slice) + // nolint: prealloc var lines []string for _, line := range slice { lines = append(lines, line.line) From 7eea6108e110b3adf879664e4dd197767cd0e100 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Tue, 10 Jul 2018 14:17:23 -0700 Subject: [PATCH 33/47] docs: even faster --- www/content/even-faster.md | 15 ++++++++++----- www/themes/hugo-apex-theme | 2 +- 2 files changed, 11 insertions(+), 6 deletions(-) diff --git a/www/content/even-faster.md b/www/content/even-faster.md index 812610d..11dc1b0 100644 --- a/www/content/even-faster.md +++ b/www/content/even-faster.md @@ -1,8 +1,13 @@ +--- +title: Make it even faster +weight: 100 +menu: true +--- + Antibody is faster than other zsh package managers, but you might want to speed it up further. -Highly recommended to read the following. +Highly recommended to read the following: -Here's some useful links: - - [Speeding up my ZSH load - Carlos Alexandro Becker](https://carlosbecker.com/posts/speeding-up-zsh/): outlines a few fixes that will speed up the prompt massively. Also explains how to debug your prompt load time. - - [Speed up zsh compinit by only checking cache once a day.](https://gist.github.com/ctechols/ca1035271ad134841284): mentioned in the previous link, but leaving this here for reference as it is helpful for anyone using zsh. - - [How to debug zsh startup time — JB on programming 1.0.0 documentation](http://jb-blog.readthedocs.io/en/latest/posts/0032-debugging-zsh-startup-time.html) +- [Speeding up my ZSH load - Carlos Alexandro Becker](https://carlosbecker.com/posts/speeding-up-zsh/): outlines a few fixes that will speed up the prompt massively. Also explains how to debug your prompt load time. +- [Speed up zsh compinit by only checking cache once a day.](https://gist.github.com/ctechols/ca1035271ad134841284): mentioned in the previous link, but leaving this here for reference as it is helpful for anyone using zsh. +- [How to debug zsh startup time — JB on programming 1.0.0 documentation](http://jb-blog.readthedocs.io/en/latest/posts/0032-debugging-zsh-startup-time.html) diff --git a/www/themes/hugo-apex-theme b/www/themes/hugo-apex-theme index cb87b6b..7a952e6 160000 --- a/www/themes/hugo-apex-theme +++ b/www/themes/hugo-apex-theme @@ -1 +1 @@ -Subproject commit cb87b6b1368824d743a5d31d824eaecd2351b783 +Subproject commit 7a952e65f3dcdc1023f35a7faf83b7b70de4631a From c5c59718dd276e9e421c5882bb1e4e2f28229c6b Mon Sep 17 00:00:00 2001 From: Josta Yee Date: Wed, 11 Jul 2018 17:50:22 +0800 Subject: [PATCH 34/47] Update docs folder link --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 95c7bd1..034fad2 100644 --- a/README.md +++ b/README.md @@ -21,7 +21,7 @@ performance. ## Documentation -Documentation can be found in the [docs folder](docs) and live +Documentation can be found in the [docs folder](www/content) and live at https://getantibody.github.io ## In the wild From b780e963f7e146f22ad2176a3acdd3044b474695 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 11 Jul 2018 22:36:13 -0700 Subject: [PATCH 35/47] fix: multiple oh-my-zsh plugins behavior --- antibodylib/antibody_test.go | 4 +++- project/git.go | 11 +++++++++++ project/git_test.go | 6 ++++-- 3 files changed, 18 insertions(+), 3 deletions(-) diff --git a/antibodylib/antibody_test.go b/antibodylib/antibody_test.go index 48226be..6bd51c2 100644 --- a/antibodylib/antibody_test.go +++ b/antibodylib/antibody_test.go @@ -66,6 +66,8 @@ func TestMultipleRepositories(t *testing.T) { "zsh-users/zsh-completions", "zsh-users/zsh-autosuggestions", "", + "robbyrussell/oh-my-zsh folder:plugins/asdf", + "robbyrussell/oh-my-zsh folder:plugins/autoenv", "# these should be at last!", "sindresorhus/pure", "zsh-users/zsh-syntax-highlighting", @@ -77,7 +79,7 @@ func TestMultipleRepositories(t *testing.T) { runtime.NumCPU(), ).Bundle() assert.NoError(t, err) - assert.Len(t, strings.Split(sh, "\n"), 27) + assert.Len(t, strings.Split(sh, "\n"), 31) } func TestHome(t *testing.T) { diff --git a/project/git.go b/project/git.go index f24a04f..be2c1c9 100644 --- a/project/git.go +++ b/project/git.go @@ -7,6 +7,7 @@ import ( "os/exec" "path/filepath" "strings" + "sync" "github.com/getantibody/folder" ) @@ -72,7 +73,17 @@ func NewGit(cwd, line string) Project { } } +var locks = map[string]*sync.Mutex{} +var lock sync.Mutex + func (g gitProject) Download() error { + lock.Lock() + if locks[g.folder] == nil { + locks[g.folder] = &sync.Mutex{} + } + lock.Unlock() + locks[g.folder].Lock() + defer locks[g.folder].Unlock() if _, err := os.Stat(g.folder); os.IsNotExist(err) { // #nosec var cmd = exec.Command("git", "clone", diff --git a/project/git_test.go b/project/git_test.go index df72b58..94bfed2 100644 --- a/project/git_test.go +++ b/project/git_test.go @@ -95,8 +95,10 @@ func TestSubFolder(t *testing.T) { func TestMultipleSubFolders(t *testing.T) { home := home() - assert.NoError(t, project.NewGit(home, "robbyrussell/oh-my-zsh folder:plugins/aws").Download()) - assert.NoError(t, project.NewGit(home, "robbyrussell/oh-my-zsh folder:plugins/battery").Download()) + assert.NoError(t, project.NewGit(home, strings.Join([]string{ + "robbyrussell/oh-my-zsh folder:plugins/aws", + "robbyrussell/oh-my-zsh folder:plugins/battery", + }, "\n")).Download()) } func home() string { From a7c77d6269c6da1311e74406666bc094413d2a17 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 11 Jul 2018 23:06:56 -0700 Subject: [PATCH 36/47] test: added bench --- antibodylib/antibody_test.go | 38 ++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) diff --git a/antibodylib/antibody_test.go b/antibodylib/antibody_test.go index 6bd51c2..cdf708e 100644 --- a/antibodylib/antibody_test.go +++ b/antibodylib/antibody_test.go @@ -82,6 +82,44 @@ func TestMultipleRepositories(t *testing.T) { assert.Len(t, strings.Split(sh, "\n"), 31) } +func BenchmarkDownload(b *testing.B) { + var bundles = strings.Join([]string{ + "robbyrussell/oh-my-zsh folder:plugins/aws", + "caarlos0/git-add-remote kind:path", + "caarlos0/jvm", + "caarlos0/ports kind:path", + "", + "# comment whatever", + "caarlos0/zsh-git-fetch-merge kind:path", + "robbyrussell/oh-my-zsh folder:plugins/battery", + "caarlos0/zsh-git-sync kind:path", + "caarlos0/zsh-mkc", + "caarlos0/zsh-open-pr kind:path", + "robbyrussell/oh-my-zsh folder:plugins/asdf", + "mafredri/zsh-async", + "rupa/z", + "Tarrasch/zsh-bd", + "", + "wbinglee/zsh-wakatime", + "zsh-users/zsh-completions", + "zsh-users/zsh-autosuggestions", + "robbyrussell/oh-my-zsh folder:plugins/autoenv", + "# these should be at last!", + "sindresorhus/pure", + "zsh-users/zsh-syntax-highlighting", + "zsh-users/zsh-history-substring-search", + }, "\n") + for i := 0; i < b.N; i++ { + home := home() + _, err := antibodylib.New( + home, + bytes.NewBufferString(bundles), + runtime.NumCPU(), + ).Bundle() + assert.NoError(b, err) + } +} + func TestHome(t *testing.T) { assert.Contains(t, antibodylib.Home(), "antibody") } From 64b32eab6a41acdcdece7fac9d8f3e96ae647c1f Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Wed, 11 Jul 2018 23:46:42 -0700 Subject: [PATCH 37/47] perf: from 29k ns/op to 27k --- antibodylib/antibody_test.go | 2 ++ project/git.go | 12 ++++-------- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/antibodylib/antibody_test.go b/antibodylib/antibody_test.go index cdf708e..bde8cb6 100644 --- a/antibodylib/antibody_test.go +++ b/antibodylib/antibody_test.go @@ -82,6 +82,8 @@ func TestMultipleRepositories(t *testing.T) { assert.Len(t, strings.Split(sh, "\n"), 31) } +// BenchmarkDownload-8 1 2907868713 ns/op 480296 B/op 2996 allocs/op v1 +// BenchmarkDownload-8 1 2708120385 ns/op 475904 B/op 3052 allocs/op v2 func BenchmarkDownload(b *testing.B) { var bundles = strings.Join([]string{ "robbyrussell/oh-my-zsh folder:plugins/aws", diff --git a/project/git.go b/project/git.go index be2c1c9..eb735fc 100644 --- a/project/git.go +++ b/project/git.go @@ -73,17 +73,13 @@ func NewGit(cwd, line string) Project { } } -var locks = map[string]*sync.Mutex{} -var lock sync.Mutex +var locks sync.Map func (g gitProject) Download() error { + l, _ := locks.LoadOrStore(g.folder, &sync.Mutex{}) + lock := l.(*sync.Mutex) lock.Lock() - if locks[g.folder] == nil { - locks[g.folder] = &sync.Mutex{} - } - lock.Unlock() - locks[g.folder].Lock() - defer locks[g.folder].Unlock() + defer lock.Unlock() if _, err := os.Stat(g.folder); os.IsNotExist(err) { // #nosec var cmd = exec.Command("git", "clone", From f464c5b9ce1cfe70f45680e49a3cb7ab2ed96db7 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 12 Jul 2018 21:44:50 -0700 Subject: [PATCH 38/47] wip: other lock strategies --- project/git.go | 26 +++++++++++++++++++------- 1 file changed, 19 insertions(+), 7 deletions(-) diff --git a/project/git.go b/project/git.go index eb735fc..e2b0b33 100644 --- a/project/git.go +++ b/project/git.go @@ -73,21 +73,33 @@ func NewGit(cwd, line string) Project { } } -var locks sync.Map +var locks = struct { + sync.Mutex + m map[string]*sync.Mutex +}{ + m: map[string]*sync.Mutex{}, +} func (g gitProject) Download() error { - l, _ := locks.LoadOrStore(g.folder, &sync.Mutex{}) - lock := l.(*sync.Mutex) - lock.Lock() - defer lock.Unlock() + if _, ok := locks.m[g.folder]; !ok { + locks.Lock() + locks.m[g.folder] = new(sync.Mutex) + locks.Unlock() + } + locks.m[g.folder].Lock() + defer locks.m[g.folder].Unlock() if _, err := os.Stat(g.folder); os.IsNotExist(err) { // #nosec - var cmd = exec.Command("git", "clone", + var cmd = exec.Command( + "git", "clone", "--recursive", "--depth", "1", + "--quiet", + "--single-branch", "-b", g.Version, g.URL, - g.folder) + g.folder, + ) cmd.Env = append(os.Environ(), "GIT_TERMINAL_PROMPT=0") if bts, err := cmd.CombinedOutput(); err != nil { From 3f571f316ae07974b0d8c5e489e0d0daf9789b1f Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 12 Jul 2018 22:24:23 -0700 Subject: [PATCH 39/47] feat: accept multiple folders --- antibodylib/antibody_test.go | 24 +++++++++++++++-------- bundle/bundle_test.go | 12 ++++++++++-- bundle/path.go | 13 +++++++++++-- bundle/zsh.go | 37 +++++++++++++++++++----------------- main.go | 6 ++++-- project/git.go | 34 +++++++++++++-------------------- project/git_test.go | 11 +++++++---- project/local.go | 4 ++-- project/local_test.go | 2 +- project/project.go | 2 +- project/project_test.go | 2 +- 11 files changed, 86 insertions(+), 61 deletions(-) diff --git a/antibodylib/antibody_test.go b/antibodylib/antibody_test.go index bde8cb6..530dd19 100644 --- a/antibodylib/antibody_test.go +++ b/antibodylib/antibody_test.go @@ -10,6 +10,7 @@ import ( "github.com/getantibody/antibody/antibodylib" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestAntibody(t *testing.T) { @@ -66,8 +67,7 @@ func TestMultipleRepositories(t *testing.T) { "zsh-users/zsh-completions", "zsh-users/zsh-autosuggestions", "", - "robbyrussell/oh-my-zsh folder:plugins/asdf", - "robbyrussell/oh-my-zsh folder:plugins/autoenv", + "robbyrussell/oh-my-zsh folder:plugins/asdf folder:plugins/autoenv", "# these should be at last!", "sindresorhus/pure", "zsh-users/zsh-syntax-highlighting", @@ -82,22 +82,31 @@ func TestMultipleRepositories(t *testing.T) { assert.Len(t, strings.Split(sh, "\n"), 31) } -// BenchmarkDownload-8 1 2907868713 ns/op 480296 B/op 2996 allocs/op v1 -// BenchmarkDownload-8 1 2708120385 ns/op 475904 B/op 3052 allocs/op v2 +func TestMultipleFolders(t *testing.T) { + home := home() + sh, err := antibodylib.New( + home, + bytes.NewBufferString( + "robbyrussell/oh-my-zsh folder:plugins/asdf folder:plugins/autoenv", + ), + runtime.NumCPU(), + ).Bundle() + require.NoError(t, err) + require.Len(t, strings.Split(sh, "\n"), 4) +} + func BenchmarkDownload(b *testing.B) { var bundles = strings.Join([]string{ - "robbyrussell/oh-my-zsh folder:plugins/aws", + "robbyrussell/oh-my-zsh folder:plugins/aws folder:plugins/battery folder:plugins/asdf folder:plugins/autoenv", "caarlos0/git-add-remote kind:path", "caarlos0/jvm", "caarlos0/ports kind:path", "", "# comment whatever", "caarlos0/zsh-git-fetch-merge kind:path", - "robbyrussell/oh-my-zsh folder:plugins/battery", "caarlos0/zsh-git-sync kind:path", "caarlos0/zsh-mkc", "caarlos0/zsh-open-pr kind:path", - "robbyrussell/oh-my-zsh folder:plugins/asdf", "mafredri/zsh-async", "rupa/z", "Tarrasch/zsh-bd", @@ -105,7 +114,6 @@ func BenchmarkDownload(b *testing.B) { "wbinglee/zsh-wakatime", "zsh-users/zsh-completions", "zsh-users/zsh-autosuggestions", - "robbyrussell/oh-my-zsh folder:plugins/autoenv", "# these should be at last!", "sindresorhus/pure", "zsh-users/zsh-syntax-highlighting", diff --git a/bundle/bundle_test.go b/bundle/bundle_test.go index e1ee842..ad6c5b0 100644 --- a/bundle/bundle_test.go +++ b/bundle/bundle_test.go @@ -7,6 +7,7 @@ import ( "github.com/getantibody/antibody/bundle" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestSuccessfullGitBundles(t *testing.T) { @@ -32,15 +33,22 @@ func TestSuccessfullGitBundles(t *testing.T) { } for _, row := range table { t.Run(row.line, func(t *testing.T) { - t.Parallel() home := home() result, err := bundle.New(home, row.line).Get() - assert.Contains(t, result, row.result) assert.NoError(t, err) + assert.Contains(t, result, row.result) }) } } +func TestMultipleFolders(t *testing.T) { + home := home() + result, err := bundle.New(home, "caarlos0/jvm kind:path folder:abc folder:defg").Get() + require.NoError(t, err) + require.Contains(t, result, "jvm/abc:") + require.Contains(t, result, "jvm/defg") +} + func TestZshInvalidGitBundle(t *testing.T) { home := home() _, err := bundle.New(home, "doesnt exist").Get() diff --git a/bundle/path.go b/bundle/path.go index 93fc83b..cfbd61e 100644 --- a/bundle/path.go +++ b/bundle/path.go @@ -1,6 +1,11 @@ package bundle -import "github.com/getantibody/antibody/project" +import ( + "fmt" + "strings" + + "github.com/getantibody/antibody/project" +) type pathBundle struct { Project project.Project @@ -10,5 +15,9 @@ func (bundle pathBundle) Get() (result string, err error) { if err = bundle.Project.Download(); err != nil { return result, err } - return "export PATH=\"" + bundle.Project.Folder() + ":$PATH\"", err + + return fmt.Sprintf( + `export PATH="%s:$PATH"`, + strings.Join(bundle.Project.Folders(), ":"), + ), err } diff --git a/bundle/zsh.go b/bundle/zsh.go index 9bc5294..923a1c8 100644 --- a/bundle/zsh.go +++ b/bundle/zsh.go @@ -14,25 +14,28 @@ type zshBundle struct { var zshGlobs = []string{"*.plugin.zsh", "*.zsh", "*.sh", "*.zsh-theme"} -func (bundle zshBundle) Get() (result string, err error) { - if err = bundle.Project.Download(); err != nil { - return result, err +func (bundle zshBundle) Get() (string, error) { + if err := bundle.Project.Download(); err != nil { + return "", err } - for _, glob := range zshGlobs { - files, err := filepath.Glob(filepath.Join(bundle.Project.Folder(), glob)) - if err != nil { - return result, err + var lines = []string{} + for _, folder := range bundle.Project.Folders() { + for _, glob := range zshGlobs { + fmt.Println("vaaaaaai", folder) + files, err := filepath.Glob(filepath.Join(folder, glob)) + if err != nil { + return "", err + } + if files == nil { + continue + } + for _, file := range files { + lines = append(lines, "source "+file) + } + lines = append(lines, fmt.Sprintf("fpath+=( %s )", folder)) + break } - if files == nil { - continue - } - var lines []string - for _, file := range files { - lines = append(lines, "source "+file) - } - lines = append(lines, fmt.Sprintf("fpath+=( %s )", bundle.Project.Folder())) - return strings.Join(lines, "\n"), err } - return result, nil + return strings.Join(lines, "\n"), nil } diff --git a/main.go b/main.go index 5724199..73e5286 100644 --- a/main.go +++ b/main.go @@ -89,8 +89,10 @@ func update() { func purge() { fmt.Println("Removing", *purgee) - var err = os.RemoveAll(project.New(antibodylib.Home(), *purgee).Folder()) - app.FatalIfError(err, "failed to purge") + for _, folder := range project.New(antibodylib.Home(), *purgee).Folders() { + var err = os.RemoveAll(folder) + app.FatalIfError(err, "failed to purge") + } } func list() { diff --git a/project/git.go b/project/git.go index e2b0b33..3d9aeed 100644 --- a/project/git.go +++ b/project/git.go @@ -7,7 +7,6 @@ import ( "os/exec" "path/filepath" "strings" - "sync" "github.com/getantibody/folder" ) @@ -16,7 +15,7 @@ type gitProject struct { URL string Version string folder string - inner string + inners []string } // NewClonedGit is a git project that was already cloned, so, only Update @@ -38,14 +37,14 @@ func NewClonedGit(home, folderName string) Project { // be downloaded to the provided cwd func NewGit(cwd, line string) Project { version := "master" - inner := "" + inners := []string{} parts := strings.Split(line, " ") for _, part := range parts { if strings.HasPrefix(part, "branch:") { version = strings.Replace(part, "branch:", "", -1) } if strings.HasPrefix(part, "folder:") { - inner = strings.Replace(part, "folder:", "", -1) + inners = append(inners, strings.Replace(part, "folder:", "", -1)) } } repo := parts[0] @@ -69,25 +68,11 @@ func NewGit(cwd, line string) Project { Version: version, URL: url, folder: folder, - inner: inner, + inners: inners, } } -var locks = struct { - sync.Mutex - m map[string]*sync.Mutex -}{ - m: map[string]*sync.Mutex{}, -} - func (g gitProject) Download() error { - if _, ok := locks.m[g.folder]; !ok { - locks.Lock() - locks.m[g.folder] = new(sync.Mutex) - locks.Unlock() - } - locks.m[g.folder].Lock() - defer locks.m[g.folder].Unlock() if _, err := os.Stat(g.folder); os.IsNotExist(err) { // #nosec var cmd = exec.Command( @@ -133,6 +118,13 @@ func branch(folder string) (string, error) { return strings.Replace(string(branch), "\n", "", -1), err } -func (g gitProject) Folder() string { - return filepath.Join(g.folder, g.inner) +func (g gitProject) Folders() []string { + if len(g.inners) == 0 { + return []string{g.folder} + } + var result = make([]string, len(g.inners)) + for i := range g.inners { + result[i] = filepath.Join(g.folder, g.inners[i]) + } + return result } diff --git a/project/git_test.go b/project/git_test.go index 94bfed2..39540e2 100644 --- a/project/git_test.go +++ b/project/git_test.go @@ -9,6 +9,7 @@ import ( "github.com/getantibody/antibody/project" "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestDownloadAllKinds(t *testing.T) { @@ -38,7 +39,7 @@ func TestDownloadAllKinds(t *testing.T) { func TestDownloadSubmodules(t *testing.T) { var home = home() var proj = project.NewGit(home, "fribmendes/geometry") - var module = filepath.Join(proj.Folder(), "lib/zsh-async") + var module = filepath.Join(proj.Folders()[0], "lib/zsh-async") assert.NoError(t, proj.Download()) assert.NoError(t, proj.Update()) files, err := ioutil.ReadDir(module) @@ -83,14 +84,16 @@ func TestDownloadFolderNaming(t *testing.T) { assert.Equal( t, home+"/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-ports", - repo.Folder(), + repo.Folders()[0], ) } func TestSubFolder(t *testing.T) { home := home() - repo := project.NewGit(home, "robbyrussell/oh-my-zsh folder:plugins/aws") - assert.True(t, strings.HasSuffix(repo.Folder(), "plugins/aws")) + repo := project.NewGit(home, "robbyrussell/oh-my-zsh folder:plugins/aws folder:plugins/asdf") + require.Len(t, repo.Folders(), 2) + assert.True(t, strings.HasSuffix(repo.Folders()[0], "plugins/aws")) + assert.True(t, strings.HasSuffix(repo.Folders()[1], "plugins/asdf")) } func TestMultipleSubFolders(t *testing.T) { diff --git a/project/local.go b/project/local.go index 958d140..59dd3bd 100644 --- a/project/local.go +++ b/project/local.go @@ -23,6 +23,6 @@ func (l localProject) Update() error { return l.Download() } -func (l localProject) Folder() string { - return l.folder +func (l localProject) Folders() []string { + return []string{l.folder} } diff --git a/project/local_test.go b/project/local_test.go index 32dfb66..a8c5dd5 100644 --- a/project/local_test.go +++ b/project/local_test.go @@ -11,5 +11,5 @@ func TestLocalProject(t *testing.T) { proj := project.NewLocal("/tmp") assert.NoError(t, proj.Download()) assert.NoError(t, proj.Update()) - assert.Equal(t, "/tmp", proj.Folder()) + assert.Equal(t, []string{"/tmp"}, proj.Folders()) } diff --git a/project/project.go b/project/project.go index a57fc6e..9ea2ffb 100644 --- a/project/project.go +++ b/project/project.go @@ -10,7 +10,7 @@ import ( type Project interface { Download() error Update() error - Folder() string + Folders() []string } // New decides what kind of project it is, based on the given line diff --git a/project/project_test.go b/project/project_test.go index d628dc3..af658a3 100644 --- a/project/project_test.go +++ b/project/project_test.go @@ -54,6 +54,6 @@ func TestUpdateHomeWithNoGitProjects(t *testing.T) { home := home() repo := project.New(home, "caarlos0/jvm") assert.NoError(t, repo.Download()) - assert.NoError(t, os.RemoveAll(filepath.Join(repo.Folder(), ".git"))) + assert.NoError(t, os.RemoveAll(filepath.Join(repo.Folders()[0], ".git"))) assert.Error(t, project.Update(home, runtime.NumCPU())) } From 7223029a99fc80567936a280daff714a5b97b116 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 12 Jul 2018 22:26:08 -0700 Subject: [PATCH 40/47] docs: multiple folders --- bundle/zsh.go | 1 - www/content/options.md | 11 +++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/bundle/zsh.go b/bundle/zsh.go index 923a1c8..cb01e1f 100644 --- a/bundle/zsh.go +++ b/bundle/zsh.go @@ -21,7 +21,6 @@ func (bundle zshBundle) Get() (string, error) { var lines = []string{} for _, folder := range bundle.Project.Folders() { for _, glob := range zshGlobs { - fmt.Println("vaaaaaai", folder) files, err := filepath.Glob(filepath.Join(folder, glob)) if err != nil { return "", err diff --git a/www/content/options.md b/www/content/options.md index 44f35c6..159a0d8 100644 --- a/www/content/options.md +++ b/www/content/options.md @@ -58,4 +58,15 @@ Example: ```console $ antibody bundle robbyrussell/oh-my-zsh folder:plugins/aws source /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/plugins/aws/aws.plugin.zsh +fpath+=( /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/plugins/aws ) +``` + +If you want multiple folders from the same plugin, you can just add +multiple `folder` options: + +```console +source /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/plugins/aws/aws.plugin.zsh +fpath+=( /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/plugins/aws ) +source /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/plugins/asdf/asdf.plugin.zsh +fpath+=( /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/plugins/asdf ) ``` From 2fc8049261cdec8e3629e7bf284594d4da92bb69 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 12 Jul 2018 22:30:20 -0700 Subject: [PATCH 41/47] Revert "feat: accept multiple folders" This reverts commit 3f571f316ae07974b0d8c5e489e0d0daf9789b1f. --- antibodylib/antibody_test.go | 24 ++++++++---------------- bundle/bundle_test.go | 12 ++---------- bundle/path.go | 13 ++----------- bundle/zsh.go | 36 +++++++++++++++++------------------- main.go | 6 ++---- project/git.go | 34 +++++++++++++++++++++------------- project/git_test.go | 11 ++++------- project/local.go | 4 ++-- project/local_test.go | 2 +- project/project.go | 2 +- project/project_test.go | 2 +- 11 files changed, 61 insertions(+), 85 deletions(-) diff --git a/antibodylib/antibody_test.go b/antibodylib/antibody_test.go index 530dd19..bde8cb6 100644 --- a/antibodylib/antibody_test.go +++ b/antibodylib/antibody_test.go @@ -10,7 +10,6 @@ import ( "github.com/getantibody/antibody/antibodylib" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestAntibody(t *testing.T) { @@ -67,7 +66,8 @@ func TestMultipleRepositories(t *testing.T) { "zsh-users/zsh-completions", "zsh-users/zsh-autosuggestions", "", - "robbyrussell/oh-my-zsh folder:plugins/asdf folder:plugins/autoenv", + "robbyrussell/oh-my-zsh folder:plugins/asdf", + "robbyrussell/oh-my-zsh folder:plugins/autoenv", "# these should be at last!", "sindresorhus/pure", "zsh-users/zsh-syntax-highlighting", @@ -82,31 +82,22 @@ func TestMultipleRepositories(t *testing.T) { assert.Len(t, strings.Split(sh, "\n"), 31) } -func TestMultipleFolders(t *testing.T) { - home := home() - sh, err := antibodylib.New( - home, - bytes.NewBufferString( - "robbyrussell/oh-my-zsh folder:plugins/asdf folder:plugins/autoenv", - ), - runtime.NumCPU(), - ).Bundle() - require.NoError(t, err) - require.Len(t, strings.Split(sh, "\n"), 4) -} - +// BenchmarkDownload-8 1 2907868713 ns/op 480296 B/op 2996 allocs/op v1 +// BenchmarkDownload-8 1 2708120385 ns/op 475904 B/op 3052 allocs/op v2 func BenchmarkDownload(b *testing.B) { var bundles = strings.Join([]string{ - "robbyrussell/oh-my-zsh folder:plugins/aws folder:plugins/battery folder:plugins/asdf folder:plugins/autoenv", + "robbyrussell/oh-my-zsh folder:plugins/aws", "caarlos0/git-add-remote kind:path", "caarlos0/jvm", "caarlos0/ports kind:path", "", "# comment whatever", "caarlos0/zsh-git-fetch-merge kind:path", + "robbyrussell/oh-my-zsh folder:plugins/battery", "caarlos0/zsh-git-sync kind:path", "caarlos0/zsh-mkc", "caarlos0/zsh-open-pr kind:path", + "robbyrussell/oh-my-zsh folder:plugins/asdf", "mafredri/zsh-async", "rupa/z", "Tarrasch/zsh-bd", @@ -114,6 +105,7 @@ func BenchmarkDownload(b *testing.B) { "wbinglee/zsh-wakatime", "zsh-users/zsh-completions", "zsh-users/zsh-autosuggestions", + "robbyrussell/oh-my-zsh folder:plugins/autoenv", "# these should be at last!", "sindresorhus/pure", "zsh-users/zsh-syntax-highlighting", diff --git a/bundle/bundle_test.go b/bundle/bundle_test.go index ad6c5b0..e1ee842 100644 --- a/bundle/bundle_test.go +++ b/bundle/bundle_test.go @@ -7,7 +7,6 @@ import ( "github.com/getantibody/antibody/bundle" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestSuccessfullGitBundles(t *testing.T) { @@ -33,22 +32,15 @@ func TestSuccessfullGitBundles(t *testing.T) { } for _, row := range table { t.Run(row.line, func(t *testing.T) { + t.Parallel() home := home() result, err := bundle.New(home, row.line).Get() - assert.NoError(t, err) assert.Contains(t, result, row.result) + assert.NoError(t, err) }) } } -func TestMultipleFolders(t *testing.T) { - home := home() - result, err := bundle.New(home, "caarlos0/jvm kind:path folder:abc folder:defg").Get() - require.NoError(t, err) - require.Contains(t, result, "jvm/abc:") - require.Contains(t, result, "jvm/defg") -} - func TestZshInvalidGitBundle(t *testing.T) { home := home() _, err := bundle.New(home, "doesnt exist").Get() diff --git a/bundle/path.go b/bundle/path.go index cfbd61e..93fc83b 100644 --- a/bundle/path.go +++ b/bundle/path.go @@ -1,11 +1,6 @@ package bundle -import ( - "fmt" - "strings" - - "github.com/getantibody/antibody/project" -) +import "github.com/getantibody/antibody/project" type pathBundle struct { Project project.Project @@ -15,9 +10,5 @@ func (bundle pathBundle) Get() (result string, err error) { if err = bundle.Project.Download(); err != nil { return result, err } - - return fmt.Sprintf( - `export PATH="%s:$PATH"`, - strings.Join(bundle.Project.Folders(), ":"), - ), err + return "export PATH=\"" + bundle.Project.Folder() + ":$PATH\"", err } diff --git a/bundle/zsh.go b/bundle/zsh.go index cb01e1f..9bc5294 100644 --- a/bundle/zsh.go +++ b/bundle/zsh.go @@ -14,27 +14,25 @@ type zshBundle struct { var zshGlobs = []string{"*.plugin.zsh", "*.zsh", "*.sh", "*.zsh-theme"} -func (bundle zshBundle) Get() (string, error) { - if err := bundle.Project.Download(); err != nil { - return "", err +func (bundle zshBundle) Get() (result string, err error) { + if err = bundle.Project.Download(); err != nil { + return result, err } - var lines = []string{} - for _, folder := range bundle.Project.Folders() { - for _, glob := range zshGlobs { - files, err := filepath.Glob(filepath.Join(folder, glob)) - if err != nil { - return "", err - } - if files == nil { - continue - } - for _, file := range files { - lines = append(lines, "source "+file) - } - lines = append(lines, fmt.Sprintf("fpath+=( %s )", folder)) - break + for _, glob := range zshGlobs { + files, err := filepath.Glob(filepath.Join(bundle.Project.Folder(), glob)) + if err != nil { + return result, err } + if files == nil { + continue + } + var lines []string + for _, file := range files { + lines = append(lines, "source "+file) + } + lines = append(lines, fmt.Sprintf("fpath+=( %s )", bundle.Project.Folder())) + return strings.Join(lines, "\n"), err } - return strings.Join(lines, "\n"), nil + return result, nil } diff --git a/main.go b/main.go index 73e5286..5724199 100644 --- a/main.go +++ b/main.go @@ -89,10 +89,8 @@ func update() { func purge() { fmt.Println("Removing", *purgee) - for _, folder := range project.New(antibodylib.Home(), *purgee).Folders() { - var err = os.RemoveAll(folder) - app.FatalIfError(err, "failed to purge") - } + var err = os.RemoveAll(project.New(antibodylib.Home(), *purgee).Folder()) + app.FatalIfError(err, "failed to purge") } func list() { diff --git a/project/git.go b/project/git.go index 3d9aeed..e2b0b33 100644 --- a/project/git.go +++ b/project/git.go @@ -7,6 +7,7 @@ import ( "os/exec" "path/filepath" "strings" + "sync" "github.com/getantibody/folder" ) @@ -15,7 +16,7 @@ type gitProject struct { URL string Version string folder string - inners []string + inner string } // NewClonedGit is a git project that was already cloned, so, only Update @@ -37,14 +38,14 @@ func NewClonedGit(home, folderName string) Project { // be downloaded to the provided cwd func NewGit(cwd, line string) Project { version := "master" - inners := []string{} + inner := "" parts := strings.Split(line, " ") for _, part := range parts { if strings.HasPrefix(part, "branch:") { version = strings.Replace(part, "branch:", "", -1) } if strings.HasPrefix(part, "folder:") { - inners = append(inners, strings.Replace(part, "folder:", "", -1)) + inner = strings.Replace(part, "folder:", "", -1) } } repo := parts[0] @@ -68,11 +69,25 @@ func NewGit(cwd, line string) Project { Version: version, URL: url, folder: folder, - inners: inners, + inner: inner, } } +var locks = struct { + sync.Mutex + m map[string]*sync.Mutex +}{ + m: map[string]*sync.Mutex{}, +} + func (g gitProject) Download() error { + if _, ok := locks.m[g.folder]; !ok { + locks.Lock() + locks.m[g.folder] = new(sync.Mutex) + locks.Unlock() + } + locks.m[g.folder].Lock() + defer locks.m[g.folder].Unlock() if _, err := os.Stat(g.folder); os.IsNotExist(err) { // #nosec var cmd = exec.Command( @@ -118,13 +133,6 @@ func branch(folder string) (string, error) { return strings.Replace(string(branch), "\n", "", -1), err } -func (g gitProject) Folders() []string { - if len(g.inners) == 0 { - return []string{g.folder} - } - var result = make([]string, len(g.inners)) - for i := range g.inners { - result[i] = filepath.Join(g.folder, g.inners[i]) - } - return result +func (g gitProject) Folder() string { + return filepath.Join(g.folder, g.inner) } diff --git a/project/git_test.go b/project/git_test.go index 39540e2..94bfed2 100644 --- a/project/git_test.go +++ b/project/git_test.go @@ -9,7 +9,6 @@ import ( "github.com/getantibody/antibody/project" "github.com/stretchr/testify/assert" - "github.com/stretchr/testify/require" ) func TestDownloadAllKinds(t *testing.T) { @@ -39,7 +38,7 @@ func TestDownloadAllKinds(t *testing.T) { func TestDownloadSubmodules(t *testing.T) { var home = home() var proj = project.NewGit(home, "fribmendes/geometry") - var module = filepath.Join(proj.Folders()[0], "lib/zsh-async") + var module = filepath.Join(proj.Folder(), "lib/zsh-async") assert.NoError(t, proj.Download()) assert.NoError(t, proj.Update()) files, err := ioutil.ReadDir(module) @@ -84,16 +83,14 @@ func TestDownloadFolderNaming(t *testing.T) { assert.Equal( t, home+"/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-ports", - repo.Folders()[0], + repo.Folder(), ) } func TestSubFolder(t *testing.T) { home := home() - repo := project.NewGit(home, "robbyrussell/oh-my-zsh folder:plugins/aws folder:plugins/asdf") - require.Len(t, repo.Folders(), 2) - assert.True(t, strings.HasSuffix(repo.Folders()[0], "plugins/aws")) - assert.True(t, strings.HasSuffix(repo.Folders()[1], "plugins/asdf")) + repo := project.NewGit(home, "robbyrussell/oh-my-zsh folder:plugins/aws") + assert.True(t, strings.HasSuffix(repo.Folder(), "plugins/aws")) } func TestMultipleSubFolders(t *testing.T) { diff --git a/project/local.go b/project/local.go index 59dd3bd..958d140 100644 --- a/project/local.go +++ b/project/local.go @@ -23,6 +23,6 @@ func (l localProject) Update() error { return l.Download() } -func (l localProject) Folders() []string { - return []string{l.folder} +func (l localProject) Folder() string { + return l.folder } diff --git a/project/local_test.go b/project/local_test.go index a8c5dd5..32dfb66 100644 --- a/project/local_test.go +++ b/project/local_test.go @@ -11,5 +11,5 @@ func TestLocalProject(t *testing.T) { proj := project.NewLocal("/tmp") assert.NoError(t, proj.Download()) assert.NoError(t, proj.Update()) - assert.Equal(t, []string{"/tmp"}, proj.Folders()) + assert.Equal(t, "/tmp", proj.Folder()) } diff --git a/project/project.go b/project/project.go index 9ea2ffb..a57fc6e 100644 --- a/project/project.go +++ b/project/project.go @@ -10,7 +10,7 @@ import ( type Project interface { Download() error Update() error - Folders() []string + Folder() string } // New decides what kind of project it is, based on the given line diff --git a/project/project_test.go b/project/project_test.go index af658a3..d628dc3 100644 --- a/project/project_test.go +++ b/project/project_test.go @@ -54,6 +54,6 @@ func TestUpdateHomeWithNoGitProjects(t *testing.T) { home := home() repo := project.New(home, "caarlos0/jvm") assert.NoError(t, repo.Download()) - assert.NoError(t, os.RemoveAll(filepath.Join(repo.Folders()[0], ".git"))) + assert.NoError(t, os.RemoveAll(filepath.Join(repo.Folder(), ".git"))) assert.Error(t, project.Update(home, runtime.NumCPU())) } From 9dbbb0624a7c453b98aceee1a6b1b3d4d5402cc8 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 12 Jul 2018 22:30:45 -0700 Subject: [PATCH 42/47] Revert "wip: other lock strategies" This reverts commit f464c5b9ce1cfe70f45680e49a3cb7ab2ed96db7. --- project/git.go | 26 +++++++------------------- 1 file changed, 7 insertions(+), 19 deletions(-) diff --git a/project/git.go b/project/git.go index e2b0b33..eb735fc 100644 --- a/project/git.go +++ b/project/git.go @@ -73,33 +73,21 @@ func NewGit(cwd, line string) Project { } } -var locks = struct { - sync.Mutex - m map[string]*sync.Mutex -}{ - m: map[string]*sync.Mutex{}, -} +var locks sync.Map func (g gitProject) Download() error { - if _, ok := locks.m[g.folder]; !ok { - locks.Lock() - locks.m[g.folder] = new(sync.Mutex) - locks.Unlock() - } - locks.m[g.folder].Lock() - defer locks.m[g.folder].Unlock() + l, _ := locks.LoadOrStore(g.folder, &sync.Mutex{}) + lock := l.(*sync.Mutex) + lock.Lock() + defer lock.Unlock() if _, err := os.Stat(g.folder); os.IsNotExist(err) { // #nosec - var cmd = exec.Command( - "git", "clone", + var cmd = exec.Command("git", "clone", "--recursive", "--depth", "1", - "--quiet", - "--single-branch", "-b", g.Version, g.URL, - g.folder, - ) + g.folder) cmd.Env = append(os.Environ(), "GIT_TERMINAL_PROMPT=0") if bts, err := cmd.CombinedOutput(); err != nil { From ff1b183ee02ece559cc2195f6b3ed646da552c89 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 12 Jul 2018 22:35:09 -0700 Subject: [PATCH 43/47] docs: multiple folders --- www/content/options.md | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/www/content/options.md b/www/content/options.md index 159a0d8..85cff54 100644 --- a/www/content/options.md +++ b/www/content/options.md @@ -61,10 +61,12 @@ source /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.co fpath+=( /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/plugins/aws ) ``` -If you want multiple folders from the same plugin, you can just add -multiple `folder` options: +If you want multiple folders from the same plugin, you can just repeat the +plugin with a different `folder` option: ```console +$ antibody bundle "robbyrussell/oh-my-zsh folder:plugins/aws + robbyrussell/oh-my-zsh folder:plugins/asdf" source /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/plugins/aws/aws.plugin.zsh fpath+=( /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/plugins/aws ) source /Users/carlos/Library/Caches/antibody/https-COLON--SLASH--SLASH-github.com-SLASH-robbyrussell-SLASH-oh-my-zsh/plugins/asdf/asdf.plugin.zsh From 5fd2c0946c72a17a7b21141bd12081f3788b25b9 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Thu, 12 Jul 2018 22:43:31 -0700 Subject: [PATCH 44/47] refactor: use require instead of assert --- Gopkg.lock | 7 +++++-- antibodylib/antibody_test.go | 32 ++++++++++++++++---------------- bundle/bundle_test.go | 26 +++++++++++++------------- project/git_test.go | 32 ++++++++++++++++---------------- project/local_test.go | 8 ++++---- project/project_test.go | 36 ++++++++++++++++++------------------ shell/init_test.go | 6 +++--- 7 files changed, 75 insertions(+), 72 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index d821024..490d1a3 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -48,7 +48,10 @@ [[projects]] name = "github.com/stretchr/testify" - packages = ["assert"] + packages = [ + "assert", + "require" + ] revision = "12b6f73e6084dad08a7c6e575284b177ecafbc71" version = "v1.2.1" @@ -82,6 +85,6 @@ [solve-meta] analyzer-name = "dep" analyzer-version = 1 - inputs-digest = "4b140a3aac0174bdf1b16a983238e58a8ee1c504cf8fc2eebb993bc14c454196" + inputs-digest = "5b4936a2f8bcec148b0561d14a01beadd347d2669c5eda2de7291ff404f86c52" solver-name = "gps-cdcl" solver-version = 1 diff --git a/antibodylib/antibody_test.go b/antibodylib/antibody_test.go index bde8cb6..dc9c19a 100644 --- a/antibodylib/antibody_test.go +++ b/antibodylib/antibody_test.go @@ -9,7 +9,7 @@ import ( "testing" "github.com/getantibody/antibody/antibodylib" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestAntibody(t *testing.T) { @@ -29,23 +29,23 @@ func TestAntibody(t *testing.T) { bytes.NewBufferString(strings.Join(bundles, "\n")), runtime.NumCPU(), ).Bundle() - assert.NoError(t, err) + require.NoError(t, err) files, err := ioutil.ReadDir(home) - assert.NoError(t, err) - assert.Len(t, files, 3) - assert.Contains(t, sh, `export PATH="/tmp:$PATH"`) - assert.Contains(t, sh, `export PATH="`+home+`/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-ports:$PATH"`) - assert.Contains(t, sh, `export PATH="`+home+`/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-jvm:$PATH"`) + require.NoError(t, err) + require.Len(t, files, 3) + require.Contains(t, sh, `export PATH="/tmp:$PATH"`) + require.Contains(t, sh, `export PATH="`+home+`/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-ports:$PATH"`) + require.Contains(t, sh, `export PATH="`+home+`/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-jvm:$PATH"`) // nolint: lll - assert.Contains(t, sh, `source `+home+`/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-zsh-open-pr/git-open-pr.plugin.zsh`) + require.Contains(t, sh, `source `+home+`/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-zsh-open-pr/git-open-pr.plugin.zsh`) } func TestAntibodyError(t *testing.T) { home := home() bundles := bytes.NewBufferString("invalid-repo") sh, err := antibodylib.New(home, bundles, runtime.NumCPU()).Bundle() - assert.Error(t, err) - assert.Empty(t, sh) + require.Error(t, err) + require.Empty(t, sh) } func TestMultipleRepositories(t *testing.T) { @@ -78,8 +78,8 @@ func TestMultipleRepositories(t *testing.T) { bytes.NewBufferString(strings.Join(bundles, "\n")), runtime.NumCPU(), ).Bundle() - assert.NoError(t, err) - assert.Len(t, strings.Split(sh, "\n"), 31) + require.NoError(t, err) + require.Len(t, strings.Split(sh, "\n"), 31) } // BenchmarkDownload-8 1 2907868713 ns/op 480296 B/op 2996 allocs/op v1 @@ -118,17 +118,17 @@ func BenchmarkDownload(b *testing.B) { bytes.NewBufferString(bundles), runtime.NumCPU(), ).Bundle() - assert.NoError(b, err) + require.NoError(b, err) } } func TestHome(t *testing.T) { - assert.Contains(t, antibodylib.Home(), "antibody") + require.Contains(t, antibodylib.Home(), "antibody") } func TestHomeFromEnvironmentVariable(t *testing.T) { - assert.NoError(t, os.Setenv("ANTIBODY_HOME", "/tmp")) - assert.Equal(t, "/tmp", antibodylib.Home()) + require.NoError(t, os.Setenv("ANTIBODY_HOME", "/tmp")) + require.Equal(t, "/tmp", antibodylib.Home()) } func home() string { diff --git a/bundle/bundle_test.go b/bundle/bundle_test.go index e1ee842..2aec30b 100644 --- a/bundle/bundle_test.go +++ b/bundle/bundle_test.go @@ -6,7 +6,7 @@ import ( "testing" "github.com/getantibody/antibody/bundle" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestSuccessfullGitBundles(t *testing.T) { @@ -35,8 +35,8 @@ func TestSuccessfullGitBundles(t *testing.T) { t.Parallel() home := home() result, err := bundle.New(home, row.line).Get() - assert.Contains(t, result, row.result) - assert.NoError(t, err) + require.Contains(t, result, row.result) + require.NoError(t, err) }) } } @@ -44,41 +44,41 @@ func TestSuccessfullGitBundles(t *testing.T) { func TestZshInvalidGitBundle(t *testing.T) { home := home() _, err := bundle.New(home, "doesnt exist").Get() - assert.Error(t, err) + require.Error(t, err) } func TestZshLocalBundle(t *testing.T) { home := home() - assert.NoError(t, ioutil.WriteFile(home+"/a.sh", []byte("echo 9"), 0644)) + require.NoError(t, ioutil.WriteFile(home+"/a.sh", []byte("echo 9"), 0644)) result, err := bundle.New(home, home).Get() - assert.Contains(t, result, "a.sh") - assert.NoError(t, err) + require.Contains(t, result, "a.sh") + require.NoError(t, err) } func TestZshInvalidLocalBundle(t *testing.T) { home := home() _, err := bundle.New(home, "/asduhasd/asdasda").Get() - assert.Error(t, err) + require.Error(t, err) } func TestZshBundleWithNoShFiles(t *testing.T) { home := home() _, err := bundle.New(home, "getantibody/antibody").Get() - assert.NoError(t, err) + require.NoError(t, err) } func TestPathInvalidLocalBundle(t *testing.T) { home := home() _, err := bundle.New(home, "/asduhasd/asdasda kind:path").Get() - assert.Error(t, err) + require.Error(t, err) } func TestPathLocalBundle(t *testing.T) { home := home() - assert.NoError(t, ioutil.WriteFile(home+"whatever.sh", []byte(""), 0644)) + require.NoError(t, ioutil.WriteFile(home+"whatever.sh", []byte(""), 0644)) result, err := bundle.New(home, home+" kind:path").Get() - assert.Equal(t, "export PATH=\""+home+":$PATH\"", result) - assert.NoError(t, err) + require.Equal(t, "export PATH=\""+home+":$PATH\"", result) + require.NoError(t, err) } func home() string { diff --git a/project/git_test.go b/project/git_test.go index 94bfed2..b6be417 100644 --- a/project/git_test.go +++ b/project/git_test.go @@ -8,7 +8,7 @@ import ( "testing" "github.com/getantibody/antibody/project" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestDownloadAllKinds(t *testing.T) { @@ -27,7 +27,7 @@ func TestDownloadAllKinds(t *testing.T) { } for _, url := range urls { home := home() - assert.NoError( + require.NoError( t, project.NewGit(home, url).Download(), "Repo "+url+" failed to download", @@ -39,48 +39,48 @@ func TestDownloadSubmodules(t *testing.T) { var home = home() var proj = project.NewGit(home, "fribmendes/geometry") var module = filepath.Join(proj.Folder(), "lib/zsh-async") - assert.NoError(t, proj.Download()) - assert.NoError(t, proj.Update()) + require.NoError(t, proj.Download()) + require.NoError(t, proj.Update()) files, err := ioutil.ReadDir(module) - assert.NoError(t, err) - assert.True(t, len(files) > 1) + require.NoError(t, err) + require.True(t, len(files) > 1) } func TestDownloadAnotherBranch(t *testing.T) { home := home() - assert.NoError(t, project.NewGit(home, "caarlos0/jvm branch:gh-pages").Download()) + require.NoError(t, project.NewGit(home, "caarlos0/jvm branch:gh-pages").Download()) } func TestUpdateNonExistentLocalRepo(t *testing.T) { home := home() repo := project.NewGit(home, "caarlos0/ports") - assert.Error(t, repo.Update()) + require.Error(t, repo.Update()) } func TestDownloadNonExistentRepo(t *testing.T) { home := home() repo := project.NewGit(home, "caarlos0/not-a-real-repo") - assert.Error(t, repo.Download()) + require.Error(t, repo.Download()) } func TestDownloadMalformedRepo(t *testing.T) { home := home() repo := project.NewGit(home, "doesn-not-exist-really branch:also-nope") - assert.Error(t, repo.Download()) + require.Error(t, repo.Download()) } func TestDownloadMultipleTimes(t *testing.T) { home := home() repo := project.NewGit(home, "caarlos0/ports") - assert.NoError(t, repo.Download()) - assert.NoError(t, repo.Download()) - assert.NoError(t, repo.Update()) + require.NoError(t, repo.Download()) + require.NoError(t, repo.Download()) + require.NoError(t, repo.Update()) } func TestDownloadFolderNaming(t *testing.T) { home := home() repo := project.NewGit(home, "caarlos0/ports") - assert.Equal( + require.Equal( t, home+"/https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-ports", repo.Folder(), @@ -90,12 +90,12 @@ func TestDownloadFolderNaming(t *testing.T) { func TestSubFolder(t *testing.T) { home := home() repo := project.NewGit(home, "robbyrussell/oh-my-zsh folder:plugins/aws") - assert.True(t, strings.HasSuffix(repo.Folder(), "plugins/aws")) + require.True(t, strings.HasSuffix(repo.Folder(), "plugins/aws")) } func TestMultipleSubFolders(t *testing.T) { home := home() - assert.NoError(t, project.NewGit(home, strings.Join([]string{ + require.NoError(t, project.NewGit(home, strings.Join([]string{ "robbyrussell/oh-my-zsh folder:plugins/aws", "robbyrussell/oh-my-zsh folder:plugins/battery", }, "\n")).Download()) diff --git a/project/local_test.go b/project/local_test.go index 32dfb66..dc44979 100644 --- a/project/local_test.go +++ b/project/local_test.go @@ -4,12 +4,12 @@ import ( "testing" "github.com/getantibody/antibody/project" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestLocalProject(t *testing.T) { proj := project.NewLocal("/tmp") - assert.NoError(t, proj.Download()) - assert.NoError(t, proj.Update()) - assert.Equal(t, "/tmp", proj.Folder()) + require.NoError(t, proj.Download()) + require.NoError(t, proj.Update()) + require.Equal(t, "/tmp", proj.Folder()) } diff --git a/project/project_test.go b/project/project_test.go index d628dc3..1b497c9 100644 --- a/project/project_test.go +++ b/project/project_test.go @@ -7,53 +7,53 @@ import ( "testing" "github.com/getantibody/antibody/project" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestList(t *testing.T) { home := home() - assert.NoError(t, project.New(home, "caarlos0/jvm branch:gh-pages").Download()) + require.NoError(t, project.New(home, "caarlos0/jvm branch:gh-pages").Download()) list, err := project.List(home) - assert.NoError(t, err) - assert.Len(t, list, 1) + require.NoError(t, err) + require.Len(t, list, 1) } func TestListEmptyFolder(t *testing.T) { home := home() list, err := project.List(home) - assert.NoError(t, err) - assert.Len(t, list, 0) + require.NoError(t, err) + require.Len(t, list, 0) } func TestListNonExistentFolder(t *testing.T) { list, err := project.List("/tmp/asdasdadadwhateverwtff") - assert.Error(t, err) - assert.Len(t, list, 0) + require.Error(t, err) + require.Len(t, list, 0) } func TestUpdate(t *testing.T) { home := home() repo := project.New(home, "caarlos0/ports") - assert.NoError(t, repo.Download()) - assert.NoError(t, repo.Update()) + require.NoError(t, repo.Download()) + require.NoError(t, repo.Update()) } func TestUpdateHome(t *testing.T) { home := home() - assert.NoError(t, project.New(home, "caarlos0/jvm").Download()) - assert.NoError(t, project.New(home, "caarlos0/ports").Download()) - assert.NoError(t, project.New(home, "/tmp").Download()) - assert.NoError(t, project.Update(home, runtime.NumCPU())) + require.NoError(t, project.New(home, "caarlos0/jvm").Download()) + require.NoError(t, project.New(home, "caarlos0/ports").Download()) + require.NoError(t, project.New(home, "/tmp").Download()) + require.NoError(t, project.Update(home, runtime.NumCPU())) } func TestUpdateNonExistentHome(t *testing.T) { - assert.Error(t, project.Update("/tmp/asdasdasdasksksksksnopeeeee", runtime.NumCPU())) + require.Error(t, project.Update("/tmp/asdasdasdasksksksksnopeeeee", runtime.NumCPU())) } func TestUpdateHomeWithNoGitProjects(t *testing.T) { home := home() repo := project.New(home, "caarlos0/jvm") - assert.NoError(t, repo.Download()) - assert.NoError(t, os.RemoveAll(filepath.Join(repo.Folder(), ".git"))) - assert.Error(t, project.Update(home, runtime.NumCPU())) + require.NoError(t, repo.Download()) + require.NoError(t, os.RemoveAll(filepath.Join(repo.Folder(), ".git"))) + require.Error(t, project.Update(home, runtime.NumCPU())) } diff --git a/shell/init_test.go b/shell/init_test.go index 585db7f..3f0e482 100644 --- a/shell/init_test.go +++ b/shell/init_test.go @@ -4,11 +4,11 @@ import ( "testing" "github.com/getantibody/antibody/shell" - "github.com/stretchr/testify/assert" + "github.com/stretchr/testify/require" ) func TestGeneratesInit(t *testing.T) { shell, err := shell.Init() - assert.NoError(t, err) - assert.NotEmpty(t, shell) + require.NoError(t, err) + require.NotEmpty(t, shell) } From ab77c3eba88768bf0102a135c479ffb342962a28 Mon Sep 17 00:00:00 2001 From: texhnolyze Date: Sat, 28 Jul 2018 09:22:51 +1000 Subject: [PATCH 45/47] fix: correctly update plugins on specific branches Existing plugin folders were not prefixed with their cache/home folder on "antibody update", leading to a failure in checking their current branch and falling back to the master branch. Resolves: #246 --- project/git.go | 5 +++-- project/git_test.go | 16 ++++++++++++++++ 2 files changed, 19 insertions(+), 2 deletions(-) diff --git a/project/git.go b/project/git.go index eb735fc..22a195a 100644 --- a/project/git.go +++ b/project/git.go @@ -22,13 +22,14 @@ type gitProject struct { // NewClonedGit is a git project that was already cloned, so, only Update // will work here. func NewClonedGit(home, folderName string) Project { - version, err := branch(folderName) + folderPath := filepath.Join(home, folderName) + version, err := branch(folderPath) if err != nil { version = "master" } url := folder.ToURL(folderName) return gitProject{ - folder: filepath.Join(home, folderName), + folder: folderPath, Version: version, URL: url, } diff --git a/project/git_test.go b/project/git_test.go index b6be417..778c7f3 100644 --- a/project/git_test.go +++ b/project/git_test.go @@ -51,6 +51,22 @@ func TestDownloadAnotherBranch(t *testing.T) { require.NoError(t, project.NewGit(home, "caarlos0/jvm branch:gh-pages").Download()) } +func TestUpdateAnotherBranch(t *testing.T) { + home := home() + repo := project.NewGit(home, "caarlos0/jvm branch:gh-pages") + require.NoError(t, repo.Download()) + alreadyClonedRepo := project.NewClonedGit(home, "https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-jvm") + require.NoError(t, alreadyClonedRepo.Update()) +} + +func TestUpdateExistentLocalRepo(t *testing.T) { + home := home() + repo := project.NewGit(home, "caarlos0/ports") + require.NoError(t, repo.Download()) + alreadyClonedRepo := project.NewClonedGit(home, "https-COLON--SLASH--SLASH-github.com-SLASH-caarlos0-SLASH-ports") + require.NoError(t, alreadyClonedRepo.Update()) +} + func TestUpdateNonExistentLocalRepo(t *testing.T) { home := home() repo := project.NewGit(home, "caarlos0/ports") From 443b59c4039a24cae7cf0914528783fde8953508 Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sun, 23 Sep 2018 16:11:44 -0300 Subject: [PATCH 46/47] fix: better _antibody closes #257 --- shell/init.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shell/init.go b/shell/init.go index f670bc0..0e0dbbd 100644 --- a/shell/init.go +++ b/shell/init.go @@ -19,7 +19,7 @@ antibody() { } _antibody() { - IFS=' ' read -A reply <<< "$(echo "bundle update list home init help")" + IFS=' ' read -A reply <<< "help bundle update home purge list init" } compctl -K _antibody antibody ` From c889ed1f687043dcd847427341e7654727c1850b Mon Sep 17 00:00:00 2001 From: Carlos Alexandro Becker Date: Sun, 23 Sep 2018 16:15:17 -0300 Subject: [PATCH 47/47] fix: deal with possible error --- main.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/main.go b/main.go index 5724199..b11aeff 100644 --- a/main.go +++ b/main.go @@ -101,5 +101,5 @@ func list() { for _, b := range projects { fmt.Fprintf(w, "%s\t%s\n", folder.ToURL(b), filepath.Join(home, b)) } - w.Flush() + app.FatalIfError(w.Flush(), "failed to flush") }