Skip to content

Commit

Permalink
metadata updates
Browse files Browse the repository at this point in the history
  • Loading branch information
kitesi committed Nov 12, 2022
1 parent 5578c14 commit 51881d5
Show file tree
Hide file tree
Showing 4 changed files with 35 additions and 6 deletions.
27 changes: 27 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
name: goreleaser

on:
push:
tags:
- 'v*'
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Set up Go
uses: actions/setup-go@v3
- name: Run GoReleaser
uses: goreleaser/goreleaser-action@v3
with:
# either 'goreleaser' (default) or 'goreleaser-pro'
distribution: goreleaser
version: latest
args: release --rm-dist
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# Your GoReleaser Pro key, if you are using the 'goreleaser-pro' distribution
# GORELEASER_KEY: ${{ secrets.GORELEASER_KEY }}
1 change: 1 addition & 0 deletions .goreleaser.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ builds:
- linux
- windows
- darwin
binary: music
archives:
- replacements:
darwin: Darwin
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ The cobra provided completion is also a bit more descriptive than I personally
like, which is why I use my own personal bash completion. It can be found in
`./completion.bash`

Note: I have `mx` as an alias for `music play`
Note: I have `m` as an alias for `music` and `mx` as an alias for `music play`

Note: You need `jq` if you want completions on `--add-to-tag|-a` or
`--set-to-tag` or `music tags [tag]`
Expand Down
11 changes: 6 additions & 5 deletions completion.bash
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,8 @@ _music_install_completions() {
*)
# depending how up to date you want this to be, you can set this variable outside of
# this function (global scope). It's still pretty fast for me so I personally won't
local music_sub_dirs=$(basename -a $MUSIC_PATH/*/ | sed 's/ /-/g' | awk '{print tolower($0)}' | tr '\n' ' ')
COMPREPLY=( $(compgen -W "${music_sub_dirs[*]}--format --ytdl-args --name --editor --music-path --help" -- ${cur_word}) )
local SONGS_SUB_DIRS=$(basename -a $MUSIC_PATH/*/ | sed 's/ /-/g' | awk '{print tolower($0)}' | tr '\n' ' ')
COMPREPLY=( $(compgen -W "${SONGS_SUB_DIRS[*]}--format --ytdl-args --name --editor --music-path --help" -- ${cur_word}) )
;;
esac

Expand All @@ -77,7 +77,7 @@ _music_tags_completions() {
local options="--editor --help --music-path --delete"

if [ -x "$(which jq)" ]; then
options+=" $(jq '.[].name' <$MUSIC_PATH/tags.json)"
options+=" $(jq 'keys[]' <$MUSIC_PATH/tags.json)"
fi

COMPREPLY=( $(compgen -W "$options" -- $cur_word ) )
Expand All @@ -98,7 +98,7 @@ _music_play_completions() {
;;
--add-to-tag|--set-to-tag|-a)
if [ -x "$(which jq)" ]; then
local tags=$(jq '.[].name' <$MUSIC_PATH/tags.json)
local tags=$(jq 'keys[]' <$MUSIC_PATH/tags.json)
COMPREPLY=( $(compgen -W "$tags" -- $cur_word) )
else
COMPREPLY=( $(compgen -W "$generic_options" -- $cur_word) )
Expand All @@ -113,4 +113,5 @@ _music_play_completions() {
}

complete -F _music_completions -o default music
complete -F _music_play_completions -o default mx
complete -F _music_completions -o default m
complete -F _music_play_completions -o default mx

0 comments on commit 51881d5

Please sign in to comment.