Skip to content

Commit

Permalink
Merge pull request #197 from uyha/master
Browse files Browse the repository at this point in the history
Create nightly build to keep (pre)releases more up-to-date
  • Loading branch information
akinomyoga authored Jun 16, 2022
2 parents 43be0e4 + 08e3cef commit a3082a0
Show file tree
Hide file tree
Showing 8 changed files with 426 additions and 46 deletions.
88 changes: 88 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
name: nightly build
on:
push:
branches:
- master

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Check out
uses: actions/checkout@v3
with:
submodules: recursive
- name: Build
run: |
pkgver=nightly-$(date +'%Y%m%d')+$(git rev-parse --short HEAD)
echo "blesh_build_pkgver=$pkgver" >> "$GITHUB_ENV"
make FULLVER="0.4.0-nightly"
sed -i "s/^_ble_base_repository=.*/_ble_base_repository=release:$pkgver/" "out/ble.sh"
- name: Test
run: make check
- name: Package
run: |
make install INSDIR="./ble-${{ env.blesh_build_pkgver }}"
tar -cJf "ble-${{ env.blesh_build_pkgver }}.tar.xz" "ble-${{ env.blesh_build_pkgver }}"
cp "ble-${{ env.blesh_build_pkgver }}.tar.xz" ble-nightly.tar.xz
- name: Release
uses: softprops/action-gh-release@v1
with:
files: |
ble-nightly.tar.xz
ble-${{ env.blesh_build_pkgver }}.tar.xz
tag_name: nightly
prerelease: true
body: |
## Usage
**Prerequisites**
Bash 3.0+ and basic POSIX utilities are required.
**Download ble-nightly.tar.xz**
Link kept updated for every nightly build:
${{ github.event.repository.url }}/releases/download/nightly/ble-nightly.tar.xz
Permalink to the current nightly build:
${{ github.event.repository.url }}/releases/download/nightly/ble-${{ env.blesh_build_pkgver }}.tar.xz
```bash
# DOWNLOAD with wget
wget ${{ github.event.repository.url }}/releases/download/nightly/ble-nightly.tar.xz
# DOWNLOAD with curl
curl -LO ${{ github.event.repository.url }}/releases/download/nightly/ble-nightly.tar.xz
# DOWNLOAD with wget (this specific nightly build)
wget ${{ github.event.repository.url }}/releases/download/nightly/ble-${{ env.blesh_build_pkgver }}.tar.xz
# DOWNLOAD with curl (this specific nightly build)
curl -LO ${{ github.event.repository.url }}/releases/download/nightly/ble-${{ env.blesh_build_pkgver }}.tar.xz
```
**Trial & Install**
```bash
# TRIAL
tar xJf ble-nightly.tar.xz
source ble-${{ env.blesh_build_pkgver }}/ble.sh
# INSTALL (quick)
tar xJf ble-nightly.tar.xz
mkdir -p ~/.local/share/blesh
cp -fR ble-${{ env.blesh_build_pkgver }}/* ~/.local/share/blesh/
echo 'source ~/.local/share/blesh' >> ~/.bashrc
# INSTALL (more robust)
tar xJf ble-nightly.tar.xz
mkdir -p ~/.local/share/blesh
cp -fR ble-${{ env.blesh_build_pkgver }}/* ~/.local/share/blesh/
# Add the following line near the top of ~/.bashrc
[[ $- == *i* ]] && source ~/.local/share/blesh/ble.sh --attach=none
# Add the following line at the end of ~/.bashrc
[[ ${BLE_VERSION-} ]] && ble-attach
```
76 changes: 66 additions & 10 deletions README-ja_JP.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
`ble.sh` (*Bash Line Editor*) はピュア Bash スクリプトで書かれたコマンドラインエディタで、標準の GNU Readline を置き換える形で動作します。

現在の開発バージョンは 0.4 です。
このスクリプトは Bash 3.0 以降で利用できますが、速度・機能などの観点から 4.0 以降ののリリース版 Bash でお使い頂くことがお薦めです。
このスクリプトは Bash 3.0 以降で利用できますが、速度・機能などの観点から 4.0 以降のリリース版 Bash でお使い頂くことがお薦めです。
現時点では、文字コードとして `UTF-8` のみの対応です。
このスクリプトは [**BSD License**](LICENSE.md) (3条項 BSD ライセンス) の下で提供されます。

Expand All @@ -25,10 +25,15 @@

## 簡単設定

`ble.sh` インストールには `git`, `make` (GNU make), and `gawk` が必要です。
`ble.sh` をお使いいただくには Bash 3.0 以上 (及び POSIX の基本的なコマンド) が必要です。
`ble.sh` を取得するには主に2つの方法があります: `git` を用いてソースを取得しビルドする方法と `curl` または `wget` を用いて nightly ビルドをダウンロードする方法です。
詳細は、試用またはインストールに関しては [節1.1](#get-from-source)[節1.2](#get-from-tarball) を、
`~/.bashrc` の設定に関しては [節1.3](#set-up-bashrc) を御覧ください。
以下、GNU make が `gmake` として提供されているシステム (BSD など) では `make``gmake` に置き換えて実行してください。

<details open><summary><b><code>git</code> を用いてソースを取得し <code>ble.sh</code> を生成</b></summary>

この方法では `git`, `make` (GNU make), 及び `gawk` が必要です。
以下、GNU make が `gmake` として提供されているシステム (BSD など) では、`make``gmake` に置き換えて実行してください。

```bash
# 簡単お試し (インストールせずにお試しいただけます)
Expand All @@ -42,24 +47,75 @@ source ble.sh/out/ble.sh
git clone --recursive https://github.com/akinomyoga/ble.sh.git
make -C ble.sh install PREFIX=~/.local
echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc
```

<details><summary><b><code>curl</code> を用いて nightly ビルドをダウンロード</b></summary>

この方法では `curl`, `tar` (オプション `J` に対応), 及び `xz` (XZ Utils) が必要です。

```bash
# 簡単お試し (インストールせずにお試しいただけます)

curl -L https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz | tar xJf -
source ble-nightly*/ble.sh

# インストール & .bashrc 簡単設定 (動かない場合は節1.3を御参照下さい)

curl -L https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz | tar xJf -
mkdir -p ~/.local/share/blesh
mv ble-nightly* ~/.local/share/blesh
echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc
```
</details>

<details><summary><b><code>wget</code> を用いて nightly ビルドをダウンロード</b></summary>

この方法では `wget`, `tar` (オプション `J` に対応), 及び `xz` (XZ Utils) が必要です。

```bash
# 簡単お試し (インストールせずにお試しいただけます)

wget -O - https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz | tar xJf -
source ble-nightly*/ble.sh

# インストール & .bashrc 簡単設定 (動かない場合は節1.3を御参照下さい)

wget -O - https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz | tar xJf -
mkdir -p ~/.local/share/blesh
mv ble-nightly* ~/.local/share/blesh
echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc
```
</details>

<details open><summary><b>パッケージ管理システムを通じてパッケージをインストール</b> (現在 AUR のみ)</summary>

この方法では対応するパッケージ管理ツールのみが必要です。

- [AUR (Arch Linux)](https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-AUR) `blesh-git` (devel), `blesh` (stable 0.3.3)
</details>

<details open><summary><b>既存の <code>ble.sh</code> を更新</b></summary>

```bash
# 更新 (ble.sh をロードした状態で)

ble-update

# 更新 (ble.sh 外部から)

bash /path/to/ble.sh --update
```
</details>

<details><summary><b><code>ble.sh</code> のパッケージ作成</b></summary>

```bash
# パッケージ作成用コマンド

git clone --recursive https://github.com/akinomyoga/ble.sh.git
make -C ble.sh install DESTDIR=/tmp/blesh-package PREFIX=/usr/local
```

パッケージ管理システムを通じて `ble.sh` をインストールする事もできます (現在 AUR のみ)。

- [AUR (Arch Linux)](https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-AUR) `blesh-git` (devel), `blesh` (stable 0.3.3)
</details>

## 機能概要

Expand Down Expand Up @@ -100,7 +156,7 @@ make -C ble.sh install DESTDIR=/tmp/blesh-package PREFIX=/usr/local
>
> ![ble.sh demo gif](https://github.com/akinomyoga/ble.sh/wiki/images/trial1.gif)
## これまでとこれから
## 来し方行く末

このプロジェクトは初めは `.bashrc` の片隅で行われた小さな実験からスタートしました。
2013年5月に `zsh-syntax-highlighting` のとある記事に触発されたのがきっかけでした。
Expand All @@ -121,7 +177,7 @@ Vimモードの実装は2017年9月に始まり2018年3月に一先ず完成と
- 2015-12 v0.1 -- 構文着色 [[v0.1.14](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.14)]
- 2018-03 v0.2 -- Vim モード [[v0.2.6](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.6)]
- 2019-02 v0.3 -- 拡張補完 [[v0.3.3](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.3)]
- 20xx-xx v0.4 (plan) -- プログラム着色 [`master`]
- 20xx-xx v0.4 (plan) -- プログラム着色 [[nightly build](https://github.com/akinomyoga/ble.sh/releases/tag/nightly)]
- 20xx-xx v0.5 (plan) -- TUI設定画面
- 20xx-xx v0.6 (plan) -- エラー診断?

Expand Down Expand Up @@ -186,7 +242,7 @@ Make 変数 `DESTDIR` または `PREFIX` が指定されている時、`ble.sh`
ダウンロード・試用・インストールの方法については各リリースページの説明を御覧ください。
現在、安定版は開発版に比べてかなり古いので様々な機能が欠けている事にご注意下さい。

- 開発版 [v0.4.0-devel2](https://github.com/akinomyoga/ble.sh/releases/tag/v0.4.0-devel2) (2020-12)
- 開発版 [v0.4.0-devel2](https://github.com/akinomyoga/ble.sh/releases/tag/v0.4.0-devel2) (2020-12), [nightly build](https://github.com/akinomyoga/ble.sh/releases/tag/nightly)
- 安定版 [v0.3.3](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.3) (2019-02 fork) 拡張補完
- 安定版 [v0.2.6](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.6) (2018-03 fork) Vim モード
- 安定版 [v0.1.14](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.14) (2015-12 fork) 構文着色
Expand Down
85 changes: 71 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,15 @@ In fact, I personally read it verbosely as /biːɛliː dɑt ɛseɪtʃ/ in my hea

## Quick instructions

Installation requires the commands `git`, `make` (GNU make), and `gawk` (in addition to `bash` and POSIX standard utilities).
For detailed descriptions, see [Sec 1.1](#get-from-source) and [Sec 1.2](#get-from-tarball) for trial/installation,
[Sec 1.3](#set-up-bashrc) for the setup of your `~/.bashrc`.
Please replace `make` with `gmake` if your system provides GNU make as `gmake` (such as in BSD).
To use `ble.sh`, Bash 3.0+ and POSIX standard utilities are required.
There are two ways to get `ble.sh`: to download and build `ble.sh` using `git`, or to download the nightly build using `curl` or `wget`.
For the detailed descriptions, see [Sec 1.1](#get-from-source) and [Sec 1.2](#get-from-tarball) for trial/installation,
and [Sec 1.3](#set-up-bashrc) for the setup of your `~/.bashrc`.

<details open><summary><b>Download and generate <code>ble.sh</code> using <code>git</code></b></summary>

This requires the commands `git`, `make` (GNU make), and `gawk` (GNU awk).
In the following, please replace `make` with `gmake` if your system provides GNU make as `gmake` (such as in BSD).

```bash
# TRIAL without installation
Expand All @@ -44,24 +49,76 @@ source ble.sh/out/ble.sh
git clone --recursive https://github.com/akinomyoga/ble.sh.git
make -C ble.sh install PREFIX=~/.local
echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc
```
</details>

<details><summary><b>Download the nightly build with <code>curl</code></b></summary>

This requires the commands `curl`, `tar` (with the support for the `J` flag), and `xz` (XZ Utils).

```bash
# TRIAL without installation

curl -L https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz | tar xJf -
source ble-nightly*/ble.sh

# Quick INSTALL to BASHRC (If this doesn't work, please follow Sec 1.3)

curl -L https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz | tar xJf -
mkdir -p ~/.local/share/blesh
mv ble-nightly* ~/.local/share/blesh
echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc
```
</details>

<details><summary><b>Download the nightly build with <code>wget</code></b></summary>

This requires the commands `wget`, `tar` (with the support for the `J` flag), and `xz` (XZ Utils).

```bash
# TRIAL without installation

wget -O - https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz | tar xJf -
source ble-nightly*/ble.sh

# Quick INSTALL to BASHRC (If this doesn't work, please follow Sec 1.3)

wget -O - https://github.com/akinomyoga/ble.sh/releases/download/nightly/ble-nightly.tar.xz | tar xJf -
mkdir -p ~/.local/share/blesh
mv ble-nightly* ~/.local/share/blesh
echo 'source ~/.local/share/blesh/ble.sh' >> ~/.bashrc
```
</details>

<details open><summary><b>Install a package using a package manager</b> (currently only AUR packages)</summary>

This only requires the corresponding package manager.

- [AUR (Arch Linux)](https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-AUR) `blesh-git` (devel), `blesh` (stable 0.3.3)
</details>

<details open><summary><b>Update an existing copy of <code>ble.sh</code></b></summary>

```bash
# UPDATE (in a ble.sh session)

ble-update

# UPDATE (outside ble.sh sessions)

bash /path/to/ble.sh --update
```
</details>

<details><summary><b>Create a package of <code>ble.sh</code></b></summary>

```bash
# PACKAGE (for package maintainers)

git clone --recursive https://github.com/akinomyoga/ble.sh.git
make -C ble.sh install DESTDIR=/tmp/blesh-package PREFIX=/usr/local
```

You may also install `ble.sh` through package-management systems (currently only AUR):

- [AUR (Arch Linux)](https://github.com/akinomyoga/ble.sh/wiki/Manual-A1-Installation#user-content-AUR) `blesh-git` (devel), `blesh` (stable 0.3.3)
</details>

## Features

Expand Down Expand Up @@ -120,7 +177,7 @@ I started working on the enhancement of the completion in August, 2018 and relea
- 2015-12 v0.1 -- Syntax highlighting [[v0.1.14](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.14)]
- 2018-03 v0.2 -- Vim mode [[v0.2.6](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.6)]
- 2019-02 v0.3 -- Enhanced completion [[v0.3.3](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.3)]
- 20xx-xx v0.4 (plan) -- programmable highlighting [`master`]
- 20xx-xx v0.4 (plan) -- programmable highlighting [[nightly build](https://github.com/akinomyoga/ble.sh/releases/tag/nightly)]
- 20xx-xx v0.5 (plan) -- TUI configuration
- 20xx-xx v0.6 (plan) -- error diagnostics?

Expand Down Expand Up @@ -185,7 +242,7 @@ To set up `.bashrc` see [Sec. 1.3](#set-up-bashrc).
For download, trial and install, see the description at each release page.
The stable versions are significantly old compared to the devel version, so many features are unavailable.

- Devel [v0.4.0-devel2](https://github.com/akinomyoga/ble.sh/releases/tag/v0.4.0-devel2) (2020-12)
- Devel [v0.4.0-devel2](https://github.com/akinomyoga/ble.sh/releases/tag/v0.4.0-devel2) (2020-12), [nightly build](https://github.com/akinomyoga/ble.sh/releases/tag/nightly)
- Stable [v0.3.3](https://github.com/akinomyoga/ble.sh/releases/tag/v0.3.3) (2019-02 fork) Enhanced completions
- Stable [v0.2.6](https://github.com/akinomyoga/ble.sh/releases/tag/v0.2.6) (2018-03 fork) Vim mode
- Stable [v0.1.14](https://github.com/akinomyoga/ble.sh/releases/tag/v0.1.14) (2015-12 fork) Syntax highlighting
Expand Down Expand Up @@ -250,7 +307,7 @@ make INSDIR="$HOME/.local/share/blesh" install

## 1.6 Uninstall

Basically you can simply delete the installed directory and the settings that user added.
Basically you can simply delete the installed directory and the settings that the user added.

- Close all the `ble.sh` sessions (the Bash interactive sessions with `ble.sh`)
- Remove the added lines in `.bashrc`.
Expand All @@ -261,7 +318,7 @@ Basically you can simply delete the installed directory and the settings that us

# 2 Basic settings

Here some of the settings for `~/.blerc` are picked up.
Here, some of the settings for `~/.blerc` are picked up.
You can find useful settings also in [Q\&A](https://github.com/akinomyoga/ble.sh/wiki/Q&A),
[Recipes](https://github.com/akinomyoga/ble.sh/wiki/Recipes)
and [`contrib` repository](https://github.com/akinomyoga/blesh-contrib).
Expand Down Expand Up @@ -519,15 +576,15 @@ If you want to accept the suggestion and immediately run the command, you can us
## 3.4 Use `sabbrev` (static abbrev expansions)

By registering words to `sabbrev`, the words can be expanded to predefined strings.
When the cursor is just after a registered word, typing <kbd>SP</kbd> causes `sabbrev` expansion.
When the cursor is just after a registered word, typing <kbd>SP</kbd> causes the `sabbrev` expansion.
For example, with the following settings, when you type <kbd>SP</kbd> after the string `command L`, the command line will be expanded to `command | less`.

```bash
# blerc
ble-sabbrev L='| less'
```

The sabbrev names that starts from `\` are also recommended since it is unlikely to conflict with the real words that is a part of the executed command.
The sabbrev names that starts with `\` plus alphabetical letters are also recommended since it is unlikely to conflict with real words that are a part of the executed command.

```bash
# blerc
Expand Down
Loading

0 comments on commit a3082a0

Please sign in to comment.