Skip to content

Commit

Permalink
Update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
babarot committed Mar 21, 2023
1 parent d77db15 commit 4b96ba8
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 8 deletions.
18 changes: 12 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,10 @@ AFX - Package manager for CLI

AFX is a package manager for command-line tools and shell plugins. afx can allow us to manage almost all things available on GitHub, Gist and so on. Before, we needed to trawl web pages to download each package one by one. It's very annoying every time we set up new machine and also it's difficult to get how many commands/plugins we installed. So afx's motivation is coming from that and to manage them with YAML files (as a code).

[![Tests][test-mark]][test-link] [![Release][release-mark]][release-link]
[![][afx-mark]][afx-link] [![][test-mark]][test-link] [![][release-mark]][release-link]

[afx-mark]: https://img.shields.io/github/v/release/b4b4r07/afx?color=EF2D5E&display_name=release&label=AFX&logo=alchemy&logoColor=EF2D5E&sort=semver
[afx-link]: https://github.com/b4b4r07/afx/releases

[test-mark]: https://github.com/b4b4r07/afx/actions/workflows/go.yaml/badge.svg
[test-link]: https://github.com/b4b4r07/afx/actions/workflows/go.yaml
Expand Down Expand Up @@ -38,14 +41,16 @@ Full document is here: [AFX](https://babarot.me/afx/)
- etc...
- Works on bash, zsh and fish

## Quick Start
## Quick Start [<sup>plus!</sup>](https://babarot.me/afx/getting-started/)

Details are here: [Getting Started - AFX](https://babarot.me/afx/getting-started/)
- [1. Install packages](#1-install-packages)
- [2. Load packages](#2-load-packages)
- [3. Update packages](#3-update-packages)
- [4. Uninstall packages](#4-uninstall-packages)

### 1. Install packages

Write YAML file with name as you like in `~/.config/afx/`. Let's say you write this code and then put it into `github.yaml`. After than you can install packages with `install` command.

```diff
+ github:
+ - name: stedolan/jq
Expand Down Expand Up @@ -130,8 +135,9 @@ $ afx uninstall

For zsh user, you can enable shell completion for afx:

```console
$ source <(afx completion zsh)
```bash
# .zshrc
source <(afx completion zsh)
```

bash and fish users are also available.
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ func Read(path string) (Config, error) {
defer f.Close()

validate := validator.New()
validate.RegisterValidation("gh-extension", ValidateGHExtension)
validate.RegisterValidation("startswith-gh-if-not-empty", ValidateGHExtension)
d := yaml.NewDecoder(
bufio.NewReader(f),
yaml.DisallowUnknownField(),
Expand Down
2 changes: 1 addition & 1 deletion pkg/config/github.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ type GitHubAs struct {
type GHExtension struct {
Name string `yaml:"name" validate:"required,startswith=gh-"`
Tag string `yaml:"tag"`
RenameTo string `yaml:"rename-to" validate:"gh-extension,excludesall=/"`
RenameTo string `yaml:"rename-to" validate:"startswith-gh-if-not-empty,excludesall=/"`
}

type GitHubOption struct {
Expand Down

0 comments on commit 4b96ba8

Please sign in to comment.