Skip to content

Commit

Permalink
Renaming to syncher
Browse files Browse the repository at this point in the history
  • Loading branch information
nwillc committed Nov 16, 2020
1 parent db14575 commit 553d9e5
Show file tree
Hide file tree
Showing 9 changed files with 28 additions and 29 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/RELEASE.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,16 @@ jobs:
run: go version

- name: Build OSX
run: GOOS=darwin GOARCH=amd64 go build
run: GOOS=darwin GOARCH=amd64 go build -o syncher

- name: Create OSX asset
run: zip -j -r asdf-bootstrap_darwin_amd64.zip asdf-bootstrap
run: zip -j -r syncher_darwin_amd64.zip syncher

- name: Build Linux
run: GOOS=linux GOARCH=amd64 go build
run: GOOS=linux GOARCH=amd64 go build -o syncher

- name: Create OSX asset
run: zip -j -r asdf-bootstrap_linux_amd64.zip asdf-bootstrap
run: zip -j -r syncher_linux_amd64.zip syncher

- name: Create Release
id: create_release
Expand All @@ -48,8 +48,8 @@ jobs:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./asdf-bootstrap_darwin_amd64.zip
asset_name: asdf-bootstrap_darwin_amd64.zip
asset_path: ./syncher_darwin_amd64.zip
asset_name: syncher_darwin_amd64.zip
asset_content_type: application/zip

- name: Upload Linux Asset
Expand All @@ -59,6 +59,6 @@ jobs:
GITHUB_TOKEN: ${{ secrets.REPO_TOKEN }}
with:
upload_url: ${{ steps.create_release.outputs.upload_url }} # This pulls from the CREATE RELEASE step above, referencing it's ID to get its outputs object, which include a `upload_url`. See this blog post for more info: https://jasonet.co/posts/new-features-of-github-actions/#passing-data-to-future-steps
asset_path: ./asdf-bootstrap_linux_amd64.zip
asset_name: asdf-bootstrap_linux_amd64.zip
asset_path: ./syncher_linux_amd64.zip
asset_name: syncher_linux_amd64.zip
asset_content_type: application/zip
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# Test binary, built with `go test -c`
*.test
syncher
asdf-bootstrap
asdf-bootstrap.zip
.idea
*.iml
2 changes: 1 addition & 1 deletion .tool-versions
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
golang 1.15.3
asdf-bootstrap 0.0.12

23 changes: 11 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
[![license](https://img.shields.io/github/license/nwillc/asdf-bootstrap.svg)](https://tldrlegal.com/license/-isc-license)
[![CI](https://github.com/nwillc/asdf-bootstrap/workflows/CI/badge.svg)](https://github.com/nwillc/asdf-bootstrap/actions?query=workflow%3CI)
[![Go Report Card](https://goreportcard.com/badge/github.com/nwillc/asdf-bootstrap)](https://goreportcard.com/report/github.com/nwillc/asdf-bootstrap)
[![license](https://img.shields.io/github/license/nwillc/syncher.svg)](https://tldrlegal.com/license/-isc-license)
[![CI](https://github.com/nwillc/syncher/workflows/CI/badge.svg)](https://github.com/nwillc/syncher/actions?query=workflow%3CI)
[![Go Report Card](https://goreportcard.com/badge/github.com/nwillc/syncher)](https://goreportcard.com/report/github.com/nwillc/syncher)
-----
# asdf-bootstrap
# asdf syncher
An [asdf](https://github.com/asdf-vm/asdf) plugin that reads an `.tool-versions` and generates the `asdf` commands to sync up with it. The use case is as follows.
You and your teammates are using asdf to manage tools, you commit a `.tool-versions` update into a repo. Someone else
clones the repo. They need to install all the required plugins and tool versions implied by the `.tool-versions`. That's
where `asdf-bootstrap` comes in. Run it, and save it's output as a script in the repo.
where `syncher` comes in. Run it, and save it's output as a script in the repo.

# Usage

```bash
asdf plugin-add asdf-bootstrap https://github.com/nwillc/asdf-bootstrap.git
asdf list all asdf-bootstrap
asdf install asdf-bootstrap 0.0.13
asdf local asdf-bootstrap 0.0.13
asdf asdf-bootstrap
asdf plugin-add syncher https://github.com/nwillc/syncher.git
asdf list all syncher
asdf install syncher 0.0.13
asdf local syncher 0.0.13
asdf syncher
```

The output from that should look like what you find here in `./bin/asdf-bootstrap.sh`.

The output from that will be a shell script you can share.
6 changes: 3 additions & 3 deletions bin/install
Original file line number Diff line number Diff line change
Expand Up @@ -28,10 +28,10 @@ install_tool() {
local binary_name=$4
local platform=$(uname | tr '[:upper:]' '[:lower:]')
local arch=amd64
local file_name="asdf-bootstrap_${platform}_${arch}.zip"
local file_name="${binary_name}_${platform}_${arch}.zip"
local bin_install_path="${install_path}/bin"
local binary_path="${bin_install_path}/${binary_name}"
local download_url=https://github.com/nwillc/asdf-bootstrap/releases/download/${version}/${file_name}
local download_url=https://github.com/nwillc/${binary_name}/releases/download/${version}/${file_name}
local download_path="${tmp_download_dir}/${file_name}"

echo "Downloading ${version} ${file_name}"
Expand All @@ -54,4 +54,4 @@ install_tool() {
tmp_download_dir="$(mktemp -d -t 'asdf_XXXXXXXX')"
trap 'rm -rf "${tmp_download_dir}"' EXIT

install_tool "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH" "$tmp_download_dir" asdf-bootstrap
install_tool "$ASDF_INSTALL_VERSION" "$ASDF_INSTALL_PATH" "$tmp_download_dir" syncher
2 changes: 1 addition & 1 deletion bin/list-all
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ set \
-o pipefail \
-o errexit

tag_url=https://api.github.com/repos/nwillc/asdf-bootstrap/releases
tag_url=https://api.github.com/repos/nwillc/syncher/releases

cmd="curl -sSL"
if [ -n "${GITHUB_API_TOKEN:-}" ]; then
Expand Down
2 changes: 1 addition & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
module github/nwillc/asdf-bootstrap
module github/nwillc/syncher

go 1.15
2 changes: 1 addition & 1 deletion lib/commands/command.bash
Original file line number Diff line number Diff line change
Expand Up @@ -22,4 +22,4 @@ set \
-o pipefail \
-o errexit

$ASDF_DIR/shims/asdf-bootstrap
$ASDF_DIR/shims/syncher
2 changes: 1 addition & 1 deletion main.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ import (
"bufio"
"flag"
"fmt"
"github/nwillc/asdf-bootstrap/gen/version"
"github/nwillc/syncher/gen/version"
"log"
"os"
"strings"
Expand Down

0 comments on commit 553d9e5

Please sign in to comment.