Skip to content

Commit caf516e

Browse files
committed
add: installation script
Signed-off-by: wxiwnd <wxiwnd@outlook.com>
1 parent d20392c commit caf516e

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

scripts/bash_pinyin_completion

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ _comp_compgen_filedir() {
2424
local -a pinyin_matches=()
2525
while IFS= read -r line; do
2626
pinyin_matches+=( "$line" )
27-
done < <( <script_path> "$cur" 2>/dev/null )
27+
done < <( bash-pinyin-completion-rs "$cur" 2>/dev/null )
2828

2929
COMPREPLY+=( "${pinyin_matches[@]}" )
3030
}

scripts/install_completion.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
#!/usr/bin/env bash
2+
set -e
3+
4+
cargo build --release
5+
echo "Install binary..."
6+
sudo cp target/release/bash-pinyin-completion-rs /usr/bin/
7+
echo "Install bash-completion script..."
8+
sudo cp scripts/bash_pinyin_completion /etc/bash_completion.d/

0 commit comments

Comments
 (0)