Skip to content

Commit

Permalink
Merge pull request #24 from tamada/release/v1.3.0
Browse files Browse the repository at this point in the history
Release/v1.3.0
  • Loading branch information
tamada authored Jun 22, 2023
2 parents 72d1987 + 05f8840 commit 199f1eb
Show file tree
Hide file tree
Showing 8 changed files with 87 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
GO=go
NAME := sibling
VERSION := 1.2.4
VERSION := 1.3.0
DIST := $(NAME)-$(VERSION)

all: test build
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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.

Expand Down
35 changes: 35 additions & 0 deletions cmd/sibling/data/sibling.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand Down
2 changes: 1 addition & 1 deletion cmd/sibling/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import (
"github.com/tamada/sibling"
)

const VERSION = "1.2.4"
const VERSION = "1.3.0"

type options struct {
absolute bool
Expand Down
35 changes: 35 additions & 0 deletions cmd/sibling/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
// }
Expand Down
2 changes: 1 addition & 1 deletion docs/config.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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]
Expand Down
12 changes: 12 additions & 0 deletions docs/content/usage.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down Expand Up @@ -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`

0 comments on commit 199f1eb

Please sign in to comment.