diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml index e2e163c..258b817 100644 --- a/.github/workflows/publish.yaml +++ b/.github/workflows/publish.yaml @@ -64,7 +64,7 @@ jobs: repo_token: ${{ secrets.GITHUB_TOKEN }} automatic_release_tag: v${{ steps.vars.outputs.tag }} title: Release v${{ steps.vars.outputs.tag }} - draft: true + draft: false prerelease: false files: | dist/sibling-${{ steps.vars.outputs.tag }}_*.tar.gz diff --git a/Makefile b/Makefile index eeb9cb7..8152d42 100644 --- a/Makefile +++ b/Makefile @@ -1,6 +1,6 @@ GO=go NAME := sibling -VERSION := 1.2.4 +VERSION := 1.3.0 DIST := $(NAME)-$(VERSION) all: test build diff --git a/README.md b/README.md index f638e3f..20acc38 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ [![Go Report Card](https://goreportcard.com/badge/github.com/tamada/sibling)](https://goreportcard.com/report/github.com/tamada/sibling) [![License](https://img.shields.io/badge/License-WTFPL-green.svg)](https://github.com/tamada/sibling/blob/master/LICENSE) -[![Version](https://img.shields.io/badge/Version-1.2.4-green.svg)](https://github.com/tamada/sibling/releases/tag/v1.2.4) +[![Version](https://img.shields.io/badge/Version-1.3.0-green.svg)](https://github.com/tamada/sibling/releases/tag/v1.3.0) get next/previous sibling directory name. diff --git a/cmd/sibling/data/sibling.bash b/cmd/sibling/data/sibling.bash index 5be1282..12fb538 100644 --- a/cmd/sibling/data/sibling.bash +++ b/cmd/sibling/data/sibling.bash @@ -25,6 +25,41 @@ __cd_sibling_filtering() { pwd } +__ls_sibling() { + traversing_type="$1" + if [[ "$1" == "" ]]; then + traversing_type="next" + fi + next=$(sibling --absolute --type $traversing_type) + sibling_status=$? + if [[ $sibling_status -ne 0 ]]; then + echo "no more siblings" + else + echo $next + ls $next + fi +} + +lsnext() { + __ls_sibling next +} + +lsprev() { + __ls_sibling previous +} + +lsrand() { + __ls_sibling rand +} + +lsfirst() { + __ls_sibling first +} + +lslast() { + __ls_sibling last +} + sibling_peco() { __cd_sibling_filtering peco } diff --git a/cmd/sibling/main.go b/cmd/sibling/main.go index b6383ac..79bc9b8 100644 --- a/cmd/sibling/main.go +++ b/cmd/sibling/main.go @@ -10,7 +10,7 @@ import ( "github.com/tamada/sibling" ) -const VERSION = "1.2.4" +const VERSION = "1.3.0" type options struct { absolute bool diff --git a/cmd/sibling/main_test.go b/cmd/sibling/main_test.go index 5737ad0..c00e34d 100644 --- a/cmd/sibling/main_test.go +++ b/cmd/sibling/main_test.go @@ -71,6 +71,41 @@ func Example_ShellFunctionGenerator() { // pwd // } // + // __ls_sibling() { + // traversing_type="$1" + // if [[ "$1" == "" ]]; then + // traversing_type="next" + // fi + // next=$(sibling --absolute --type $traversing_type) + // sibling_status=$? + // if [[ $sibling_status -ne 0 ]]; then + // echo "no more siblings" + // else + // echo $next + // ls $next + // fi + // } + // + // lsnext() { + // __ls_sibling next + // } + // + // lsprev() { + // __ls_sibling previous + // } + // + // lsrand() { + // __ls_sibling rand + // } + // + // lsfirst() { + // __ls_sibling first + // } + // + // lslast() { + // __ls_sibling last + // } + // // sibling_peco() { // __cd_sibling_filtering peco // } diff --git a/docs/config.toml b/docs/config.toml index 7868442..8f1725c 100644 --- a/docs/config.toml +++ b/docs/config.toml @@ -15,7 +15,7 @@ pygmentsStyle = "pygments" project_tagline = "get next/previous sibling directory name" dateFormat = "2006-01-02" katex = true - version = "1.2.4" + version = "1.3.0" footer = "[![GitHub](https://img.shields.io/badge/GitHub-tamada/sibling-blueviolet.svg?logo=github)](https://github.com/tamada/sibling) Made with [Hugo](https://gohugo.io/). Theme by [Cayman](https://github.com/zwbetz-gh/cayman-hugo-theme). Deployed to [GitHub Pages](https://pages.github.com/)." [menu] diff --git a/docs/content/usage.md b/docs/content/usage.md index c1025cf..cc9211b 100644 --- a/docs/content/usage.md +++ b/docs/content/usage.md @@ -33,6 +33,8 @@ Therefore, write the snippet (`eval "$(sibling --init bash)"`) into your `.bash_ #### :abcd: `change_directory_to_sibling` +This function changes the working directory to the sibling directory. + ```sh function __change_directory_to_sibling() { traversing_type="$1" @@ -92,3 +94,13 @@ function cdrand() { __change_directory_to_sibling random } ``` + +#### :abcd: `list files of the sibling directory` + +This function lists the specified sibling directory. + +* `lsnext` +* `lsprev` +* `lsrand` +* `lsfirst` +* `lslast`