bin: reformat scripts

This commit is contained in:
Oleksandr Smirnov 2025-03-27 16:02:21 +02:00
parent 189069980e
commit c6b3d720d3
No known key found for this signature in database
3 changed files with 23 additions and 16 deletions

View file

@ -8,5 +8,5 @@ bat cache --build
read -p $'\e[32mDo you want to set the theme to tokyonight_night?\e[0m [y/N]:' -n 1 -r read -p $'\e[32mDo you want to set the theme to tokyonight_night?\e[0m [y/N]:' -n 1 -r
if [[ $REPLY =~ ^[Yy]$ ]]; then if [[ $REPLY =~ ^[Yy]$ ]]; then
echo '--theme="tokyonight_night"' >> "$(bat --config-dir)/config" echo '--theme="tokyonight_night"' >>"$(bat --config-dir)/config"
fi fi

31
bin/ex
View file

@ -1,23 +1,26 @@
#!/usr/bin/env bash #!/usr/bin/env bash
ex () { ex() {
file=$1 file=$1
[ -z "$file" ] && echo 'ex <compressed>' && return 1 [ -z "$file" ] && echo 'ex <compressed>' && return 1
[ ! -f "$file" ] && echo 'Invalid file: `'"$file"'`' && return 1 [ ! -f "$file" ] && echo 'Invalid file: `'"$file"'`' && return 1
case "$file" in case "$file" in
*.tar.bz2) tar xjf "$file";; *.tar.bz2) tar xjf "$file" ;;
*.tar.gz) tar xzf "$file";; *.tar.gz) tar xzf "$file" ;;
*.bz2) bunzip2 "$file";; *.bz2) bunzip2 "$file" ;;
*.rar) unrar x "$file";; *.rar) unrar x "$file" ;;
*.gz) gunzip "$file";; *.gz) gunzip "$file" ;;
*.tar) tar xf "$file";; *.tar) tar xf "$file" ;;
*.tbz2) tar xjf "$file";; *.tbz2) tar xjf "$file" ;;
*.tgz) tar xzf "$file";; *.tgz) tar xzf "$file" ;;
*.zip) unzip "$file";; *.zip) unzip "$file" ;;
*.Z) uncompress "$file";; *.Z) uncompress "$file" ;;
*.7z) 7z x "$file";; *.7z) 7z x "$file" ;;
*.xz) unxz "$file";; *.xz) unxz "$file" ;;
*) echo 'Unknown suffix on file: `'"$file"'`'; return 1 ;; *)
echo 'Unknown suffix on file: `'"$file"'`'
return 1
;;
esac esac
} }

View file

@ -1,2 +1,6 @@
#!/usr/bin/env bash #!/usr/bin/env bash
exec npm i -g yaml-language-server vscode-langservers-extracted typescript-language-server bash-language-server exec npm i -g npm \
yaml-language-server \
vscode-langservers-extracted \
typescript-language-server \
bash-language-server