OSDN Git Service

check for nvim before setting EDITOR
authorpaperbenni <paperbenni@gmail.com>
Fri, 2 Oct 2020 20:21:25 +0000 (22:21 +0200)
committerpaperbenni <paperbenni@gmail.com>
Fri, 2 Oct 2020 20:21:25 +0000 (22:21 +0200)
rootinstall.sh

index 168d1b4..ee07d56 100755 (executable)
@@ -24,7 +24,7 @@ ugroup() {
 ugroup video
 ugroup input
 
-RAW="https://raw.githubusercontent.com"
+export RAW="https://raw.githubusercontent.com"
 
 # adds permanent global environment variable
 addenv() {
@@ -48,7 +48,9 @@ addenv() {
 
 addenv -f "QT_QPA_PLATFORMTHEME" "qt5ct"
 addenv -f "PAGER" "less"
-addenv -f "EDITOR" "$(which nvim)"
+if which nvim; then
+    addenv -f "EDITOR" "$(which nvim)"
+fi
 addenv -f "XDG_MENU_PREFIX" "gnome-"
 
 # needed for instantLOCK
@@ -71,8 +73,10 @@ fi
 if ! grep -q '# nord colors' /etc/profile; then
     echo "applying color scheme"
 
-    echo '# nord colors' >>/etc/profile
-    echo 'if [ "$TERM" = "linux" ]; then' >>/etc/profile
+    {
+        echo '# nord colors'
+        echo 'if [ "$TERM" = "linux" ]; then'
+    } >>/etc/profile
 
     cat <<EOT >>/etc/profile
     echo -en "\e]P0383c4a" #black