From a97449b116371b33a2cbc3b17f3938ef74c60385 Mon Sep 17 00:00:00 2001 From: Jose Vega Date: Fri, 29 Sep 2023 13:07:58 +0200 Subject: [PATCH 1/2] installer refactored --- README.md | 6 ++++-- linux-install.sh => linux_installer | 23 +++++++++++++++-------- 2 files changed, 19 insertions(+), 10 deletions(-) rename linux-install.sh => linux_installer (51%) mode change 100755 => 100644 diff --git a/README.md b/README.md index 1b8cd9d..e89d874 100644 --- a/README.md +++ b/README.md @@ -163,8 +163,10 @@ Embervim does not provide any installation scripts or programs that will install this configuration for you. Configuration directories often live in different places for different operating systems. Fret not, embervim is *really* easy to install: -1. Navigate to `$XDG_CONFIG_HOME/nvim` -2. Replace the `nvim` directory (if it exists) with the one in this repository +1. run the installer in terminal +```bash +bash <(curl -s https://raw.githubusercontent.com/jvegaf/embervim/install-script/linux_installer) +``` 3. Launch neovim Thats it, you're ready to go! diff --git a/linux-install.sh b/linux_installer old mode 100755 new mode 100644 similarity index 51% rename from linux-install.sh rename to linux_installer index 2b72360..882c96a --- a/linux-install.sh +++ b/linux_installer @@ -1,24 +1,31 @@ -#!/bin/bash +#!/usr/bin/env bash + +set -euo pipefail + read -r -p "Old NeoVim configuration files will be deleted. Are you sure you want to proceed? [y/N] " response if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]] then echo "Cloning repository..." - git clone https://github.com/danlikestocode/embervim - echo "Changing directory..." - cd embervim - echo "Installing new configuration files..." + git clone --branch install-script https://github.com/jvegaf/embervim + # git clone https://github.com/jvegaf/embervim echo "Removing old configuration files..." echo "WARN: Old configuration files will be deleted!" - rm -rd ~/.config/nvim/ + rm -rf $HOME/.config/nvim + rm -rf $HOME/.cache/nvim + rm -rf $HOME/.local/share/nvim + rm -rf $HOME/.local/state/nvim echo "Copying new configuration files..." - cp -R ./nvim/ ~/.config/nvim/ + mv ./embervim/nvim $HOME/.config + echo "Cleaning...." + rm -rf ./embervim echo "Finished!" - echo "Make sure to clean up the created Git repository!" else echo "Stopped installation!" fi +exit 0 + From 3297d9e876eeca5c98a56f2dbd6f2bde6873efe2 Mon Sep 17 00:00:00 2001 From: Jose Vega Date: Sat, 30 Sep 2023 00:27:17 +0200 Subject: [PATCH 2/2] fixes --- linux_installer | 17 ++++++++--------- 1 file changed, 8 insertions(+), 9 deletions(-) diff --git a/linux_installer b/linux_installer index 882c96a..ad667fc 100644 --- a/linux_installer +++ b/linux_installer @@ -6,19 +6,18 @@ set -euo pipefail read -r -p "Old NeoVim configuration files will be deleted. Are you sure you want to proceed? [y/N] " response if [[ "$response" =~ ^([yY][eE][sS]|[yY])$ ]] then - echo "Cloning repository..." - git clone --branch install-script https://github.com/jvegaf/embervim - # git clone https://github.com/jvegaf/embervim echo "Removing old configuration files..." echo "WARN: Old configuration files will be deleted!" - rm -rf $HOME/.config/nvim - rm -rf $HOME/.cache/nvim - rm -rf $HOME/.local/share/nvim - rm -rf $HOME/.local/state/nvim + rm -rf "$HOME/.config/nvim" + rm -rf "$HOME/.cache/nvim" + rm -rf "$HOME/.local/share/nvim" + rm -rf "$HOME/.local/state/nvim" + echo "Cloning repository..." + git clone https://github.com/danlikestocode/embervim echo "Copying new configuration files..." - mv ./embervim/nvim $HOME/.config + mv "./embervim/nvim" "$HOME/.config" echo "Cleaning...." - rm -rf ./embervim + rm -rf "./embervim" echo "Finished!" else echo "Stopped installation!"