aboutsummaryrefslogtreecommitdiff
path: root/bootstrap/neovim-dict.sh
diff options
context:
space:
mode:
Diffstat (limited to 'bootstrap/neovim-dict.sh')
-rwxr-xr-xbootstrap/neovim-dict.sh88
1 files changed, 44 insertions, 44 deletions
diff --git a/bootstrap/neovim-dict.sh b/bootstrap/neovim-dict.sh
index ee51db7..77a7db8 100755
--- a/bootstrap/neovim-dict.sh
+++ b/bootstrap/neovim-dict.sh
@@ -1,44 +1,44 @@
1#!/bin/sh 1#!/bin/sh
2set -eu 2set -eu
3 3
4SPELL_DIR="$HOME/.local/share/nvim/site/spell" 4SPELL_DIR="$HOME/.local/share/nvim/site/spell"
5mkdir -p "$SPELL_DIR" 5mkdir -p "$SPELL_DIR"
6 6
7cd "$SPELL_DIR" 7cd "$SPELL_DIR"
8 8
9die() { 9die() {
10 printf 'Fehler: %s\n' "$*" >&2 10 printf 'Fehler: %s\n' "$*" >&2
11 exit 1 11 exit 1
12} 12}
13 13
14have() { 14have() {
15 command -v "$1" >/dev/null 2>&1 15 command -v "$1" >/dev/null 2>&1
16} 16}
17 17
18download() { 18download() {
19 url="$1" 19 url="$1"
20 file=$(basename "$url") 20 file=$(basename "$url")
21 21
22 if [ -f "$file" ]; then 22 if [ -f "$file" ]; then
23 printf "✓ %-32s vorhanden\n" "$file" 23 printf "✓ %-32s vorhanden\n" "$file"
24 return 24 return
25 fi 25 fi
26 26
27 printf "→ Lade %s herunter\n" "$file" 27 printf "→ Lade %s herunter\n" "$file"
28 if have wget; then 28 if have wget; then
29 wget -q --show-progress "$url" 29 wget -q --show-progress "$url"
30 elif have curl; then 30 elif have curl; then
31 curl -fLO "$url" 31 curl -fLO "$url"
32 else 32 else
33 die "weder wget noch curl gefunden" 33 die "weder wget noch curl gefunden"
34 fi 34 fi
35} 35}
36 36
37main() { 37main() {
38 download "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl" 38 download "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.spl"
39 download "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug" 39 download "https://ftp.nluug.nl/pub/vim/runtime/spell/de.utf-8.sug"
40 40
41 printf "\nWörterbücher für Neovim installiert!\n" 41 printf "\nWörterbücher für Neovim installiert!\n"
42} 42}
43 43
44main "$@" 44main "$@"