From 99b7fb97286b8f25d7dc03fd77f11c9fd7b3e9cc Mon Sep 17 00:00:00 2001 From: Sameer Rahmani Date: Thu, 29 Dec 2022 12:10:26 +0000 Subject: [PATCH] Fix the installer script to run on macos --- core/cubes/editor.el | 4 ++- scripts/install_files.sh | 59 +++++++++++++++++++++++----------------- 2 files changed, 37 insertions(+), 26 deletions(-) diff --git a/core/cubes/editor.el b/core/cubes/editor.el index e6a37ca..2ff655f 100644 --- a/core/cubes/editor.el +++ b/core/cubes/editor.el @@ -141,7 +141,9 @@ data. The typical example of this would be Lisp or Scheme source code." :flag paredit :flag-default t) (fpkg/use paredit - :hook (prog-mode . paredit-mode))) + :hook ((emacs-lisp-mode . paredit-mode) + (clojure-mode . paredit-mode) + (scheme-mode . paredit-mode)))) (defcube fg42/cursor-cube diff --git a/scripts/install_files.sh b/scripts/install_files.sh index 2d9faa2..30cf3f0 100644 --- a/scripts/install_files.sh +++ b/scripts/install_files.sh @@ -48,48 +48,57 @@ install_fonts() { wget "https://dl.fg42.org/fonts/0.1.0.tar.gz" -O ~/.fonts/fg42.tar.gz tar zxf ~/.fonts/fg42.tar.gz -C ~/.fonts --strip 1 - cp -r $fg42_home/share/fonts/vazir/* ~/.fonts/ + cp -r "$fg42_home/share/fonts/vazir/*" ~/.fonts/ info "Font installation is done." } install_runners() { info "Creating the runner scripts..." - cp $current/templates/fg42 $current/../fg42 - cp $current/templates/fg42-wm $current/../fg42-wm - sed -i "s'___FG42_HOME___'$fg42_home'" $fg42_home/fg42 - sed -i "s'___FG42_HOME___'$fg42_home'" $fg42_home/fg42-wm + cp "$current/templates/fg42" "$current/../fg42" + cp "$current/templates/fg42-wm" "$current/../fg42-wm" + sed -i'' "s'___FG42_HOME___'$fg42_home'" "$fg42_home/fg42" + sed -i'' "s'___FG42_HOME___'$fg42_home'" "$fg42_home/fg42-wm" - chmod +x $fg42_home/fg42 - chmod +x $fg42_home/fg42-wm + chmod +x "$fg42_home/fg42" + chmod +x" $fg42_home/fg42-wm" info "Copying conifg file to ~/.fg42.el..." - cp $fg42_home/config/fg42.user.el ~/.fg42.el + cp "$fg42_home/config/fg42.user.el" ~/.fg42.el info "Installing the runners..." sudo mkdir -p /usr/local/bin/ sudo rm -f /usr/local/bin/fg42 sudo rm -f /usr/local/bin/fg42-wm - sudo ln -s $fg42_home/fg42 /usr/local/bin/fg42 - sudo ln -s $fg42_home/fg42-wm /usr/local/bin/fg42-wm + sudo ln -s "$fg42_home/fg42" /usr/local/bin/fg42 + sudo ln -s "$fg42_home/fg42-wm" /usr/local/bin/fg42-wm - info "Copying share files..." - sudo mkdir -p /usr/share/fg42/ - sudo mkdir -p /usr/local/share/applications - sudo cp $fg42_home/share/applications/fg42.desktop /usr/local/share/applications - sudo cp -r $fg42_home/share/icons/hicolor/ /usr/local/share/icons - sudo cp -r $fg42_home/share/* /usr/share/fg42/ - sudo mkdir -p /usr/share/xsessions/ - sudo cp -r $fg42_home/share/xsessions/fg42.desktop /usr/share/xsessions/ + if [[ "$OSTYPE" == "linux-gnu"* ]]; then + info "Copying share files..." + sudo mkdir -p /usr/share/fg42/ + sudo mkdir -p /usr/local/share/applications + sudo cp "$fg42_home/share/applications/fg42.desktop" /usr/local/share/applications + sudo cp -r "$fg42_home/share/icons/hicolor/" /usr/local/share/icons + sudo cp -r "$fg42_home/share/*" /usr/share/fg42/ + sudo mkdir -p /usr/share/xsessions/ + sudo cp -r "$fg42_home/share/xsessions/fg42.desktop" /usr/share/xsessions/ + else + info "Skipping share files since this is not a Linux env..." + fi } install_extras() { - info "Copying share files..." - sudo mkdir -p /usr/share/fg42/ - sudo cp $fg42_home/share/applications/fg42.desktop /usr/local/share/applications - sudo cp -r $fg42_home/share/icons/hicolor/ /usr/local/share/icons - sudo cp -r $fg42_home/share/* /usr/share/fg42/ - sudo cp -r $fg42_home/share/xsessions/fg42.desktop /usr/share/xsessions/ + if [[ "$OSTYPE" == "linux-gnu"* ]]; then + info "Copying share files..." + sudo mkdir -p /usr/share/fg42/ + sudo cp "$fg42_home/share/applications/fg42.desktop" /usr/local/share/applications + sudo cp -r "$fg42_home/share/icons/hicolor/" /usr/local/share/icons + sudo cp -r "$fg42_home/share/*" /usr/share/fg42/ + sudo cp -r "$fg42_home/share/xsessions/fg42.desktop" /usr/share/xsessions/ + else + info "Skipping share files since this is not a Linux env..." + fi + } -install_$1 +eval "install_$1"