Skip to content

Commit

Permalink
0.4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
progrhyme committed Jul 3, 2020
1 parent 7b34c20 commit 6a7312c
Show file tree
Hide file tree
Showing 4 changed files with 64 additions and 21 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 0.4.0 (2020-07-03)

Feature: ([#4](https://github.com/progrhyme/binq/pull/4))

- (CLI) Add `new` subcommand to generate Item JSON
- (CLI) Add `revise` subcommand to add/edit/delete a Version in Item JSON
- (schema/item) Add functions to create/update/output Item data structure
- (schema/item) Support CRC checksum

Change: ([#4](https://github.com/progrhyme/binq/pull/4))

- (schema) Move Item-related functionality to "schema/item" subpackage
- (CLI) Add `version` subcommand and obsolete `-V|--version` option

## 0.3.1 (2020-07-01)

Feature: ([#3](https://github.com/progrhyme/binq/pull/3))
Expand Down
67 changes: 48 additions & 19 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ Typical commands to achieve this are following:

```sh
bin=/usr/local/bin # Change to your favorite path
version=0.3.1 # Make sure this is the latest
version=0.4.0 # Make sure this is the latest
os=darwin # or "linux" is supported
tmpfile=$(mktemp)
curl -Lo $tmpfile "https://github.com/progrhyme/binq/releases/download/v${version}/binq_${version}_${os}_amd64.zip"
Expand All @@ -42,20 +42,24 @@ go get github.com/progrhyme/binq
Syntax:

```sh
# Download & Extract
binq [-t|--target] SOURCE \
# Main Command. Download & Extract target binary/archive
binq [install] [-t|--target] SOURCE \
[-d|--dir OUTPUT_DIR] [-f|--file OUTFILE] \
[-s|--server SERVER] \
[-z|--no-extract] [-X|--no-exec] \
[-v|--verbose] [--debug]

# Show help
binq -h|--help
# Other Commands
binq new # Create Item JSON for Index Server
binq revise # Add/Edit/Delete a version in Item JSON
binq version # Show binq version

# Show version
binq -V|--version
# Show help
binq [COMMAND] -h|--help
```

## binq install

Examples:

```sh
Expand All @@ -65,25 +69,50 @@ binq https://github.com/peco/peco/releases/download/v0.5.7/peco_darwin_amd64.zip
binq https://github.com/stedolan/jq/releases/download/jq-1.6/jq-linux64 \
-d path/to/bin -f jq

# With index server
# With Index Server
binq -s https://progrhy.me/binq-index peco -d path/to/bin
export BINQ_SERVER=https://progrhy.me/binq-index
binq jq -d path/to/bin -f jq
```

Options:
[Index Server](#binq-index-server) serves meta data of downloadable items by `binq`.
See following section for more details.

Command Specific Options of `binq install`:

```
--debug show debug messages
-d, --directory string output directory
-f, --file string output file name
-h, --help show help
-X, --no-exec don't care for executable files
-z, --no-extract don't extract archive
-s, --server string index server URL
-t, --target string Target Item (Name or URL)
-v, --verbose verbose output
-V, --version show version
-d, --directory string # Output Directory
-f, --file string # Output File name
-X, --no-exec # Don't care for executable files
-z, --no-extract # Don't extract archive
-s, --server string # Index Server URL
-t, --target string # Target Item (Name or URL)
```

## Manipulate Item JSON

`binq` has some commands to create/edit **Item JSON** for [Binq Index Server](#binq-index-server).
Each Item JSON represents a manifest to download & install item by `binq` command.
It includes followings:

- **Download URL format** to determine the URL for specific version, OS or architecture
- **Versions** available for download
- **Checksums** to verify downloaded items

Commands Syntax:

```sh
# Generate Item JSON
binq new URL_FORMAT [VERSION] [-f|--file OUTPUT_FILE] \
[-r|--replace REPLACEMENTS] [-e|--ext EXTENSIONS]

# Add or Update Version in Item JSON
binq revise ITEM_JSON_FILE VERSION \
[-s|--sum CHECKSUMS] [-u|--url URL_FORMAT] [-r|--replace REPLACEMENTS] [-e|--ext EXTENSIONS] \
[--latest] [--no-latest] [-y|--yes]

# Delete Version in Item JSON
binq revise ITEM_JSON_FILE VERSION --delete [-y|--yes]
```

# Binq Index Server
Expand Down
2 changes: 1 addition & 1 deletion binq.go
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package binq

const (
Version = "0.3.1"
Version = "0.4.0"
EnvKeyServer = "BINQ_SERVER"
)
2 changes: 1 addition & 1 deletion internal/cli/revise.go
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,7 @@ Usage:
[--latest] [--no-latest] [-y|--yes]
# Delete Version
<<.prog>> <<.name>> path/to/item.json VERSION [--delete] [-y|--yes]
<<.prog>> <<.name>> path/to/item.json VERSION --delete [-y|--yes]
Examples:
# Add v0.1.1 if not exist
Expand Down

0 comments on commit 6a7312c

Please sign in to comment.