From bbab9fc9eb0eb627aa124bf6d2ee81ba6b598331 Mon Sep 17 00:00:00 2001 From: Diogo Telheiro do Nascimento <44041957+Diogo364@users.noreply.github.com> Date: Tue, 6 May 2025 17:04:21 -0400 Subject: [PATCH 1/7] Add custom flag to set INSTALL_DIR With this change we can easily change the INSTALL_DIR variable by using the -p flag. It defaults to /root when not used. --- install.sh | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 064e311..7039c18 100755 --- a/install.sh +++ b/install.sh @@ -4,7 +4,18 @@ # AUTHOR: Thomas Patton # install directory -INSTALL_DIR="/root/" + +while getopts ":p:" opt; do + case ${opt} in + p) + INSTALL_DIR="${OPTARG}" + ;; + esac +done +shift $((OPTIND-1)) + + +INSTALL_DIR="${INSTALL_DIR:-/root}" echo "Running Docker container setup..." From b570d611a7c8c58b7deac1b1c09fe8d47a7fe962 Mon Sep 17 00:00:00 2001 From: Diogo Telheiro do Nascimento <44041957+Diogo364@users.noreply.github.com> Date: Tue, 6 May 2025 17:05:13 -0400 Subject: [PATCH 2/7] Add help message Add -h flag to display a help message. --- install.sh | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/install.sh b/install.sh index 7039c18..a7c5926 100755 --- a/install.sh +++ b/install.sh @@ -5,11 +5,29 @@ # install directory -while getopts ":p:" opt; do + +show_help() { + cat < Date: Tue, 6 May 2025 17:06:39 -0400 Subject: [PATCH 3/7] Add reuse of setted variables Reuse setted variables throughout the script. --- install.sh | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/install.sh b/install.sh index a7c5926..0b3e88d 100755 --- a/install.sh +++ b/install.sh @@ -38,14 +38,14 @@ INSTALL_DIR="${INSTALL_DIR:-/root}" echo "Running Docker container setup..." # Update XDG_CONFIG_HOME -export XDG_CONFIG_HOME="${INSTALL_DIR}.config" -export XDG_DATA_HOME="${INSTALL_DIR}.local/share" -export XDG_STATE_HOME="${INSTALL_DIR}.local/state" +export XDG_CONFIG_HOME="${INSTALL_DIR}/.config" +export XDG_DATA_HOME="${INSTALL_DIR}/.local/share" +export XDG_STATE_HOME="${INSTALL_DIR}/.local/state" export TERM="xterm-256color" export DISPLAY=":0" cd "$INSTALL_DIR" -rm -rf "${INSTALL_DIR}.config" +rm -rf "${XDG_CONFIG_HOME}" sudo apt-get update # CLANG @@ -60,14 +60,14 @@ sudo apt-get install -y xclip # NPM curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash -export NVM_DIR="$INSTALL_DIR.config/nvm" +export NVM_DIR="${XDG_CONFIG_HOME}/nvm" [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm nvm install 16.15.1 # NEOVIM wget https://github.com/neovim/neovim/releases/download/v0.9.5/nvim-linux64.tar.gz tar xzvf nvim-linux64.tar.gz -sudo ln -s "${INSTALL_DIR}nvim-linux64/bin/nvim" /usr/local/bin/nvim +sudo ln -s "${INSTALL_DIR}/nvim-linux64/bin/nvim" /usr/local/bin/nvim sudo apt-get install -y python3-venv # RIPGREP @@ -76,7 +76,7 @@ sudo apt-get install "./ripgrep_13.0.0_amd64.deb" # Git Repository (provided as an argument) if [ -n "$1" ]; then - git clone "$1" "${INSTALL_DIR}.config/nvim" + git clone "$1" "${XDG_CONFIG_HOME}/nvim" else echo "Git repository URL not provided, proceeding without" fi From 986f4cc39055d41356eafc8f45bf45ae7d3ada93 Mon Sep 17 00:00:00 2001 From: Diogo Telheiro do Nascimento <44041957+Diogo364@users.noreply.github.com> Date: Wed, 7 May 2025 13:38:46 -0400 Subject: [PATCH 4/7] Update to Neovim v0.11 --- install.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index 0b3e88d..e7712ee 100755 --- a/install.sh +++ b/install.sh @@ -34,6 +34,8 @@ shift $((OPTIND-1)) INSTALL_DIR="${INSTALL_DIR:-/root}" +NEOVIM_DIR=nvim-linux-x86_64 +NEOVIM_INSTALLER="https://github.com/neovim/neovim/releases/download/v0.11.1/${NEOVIM_DIR}.tar.gz" echo "Running Docker container setup..." @@ -65,9 +67,9 @@ export NVM_DIR="${XDG_CONFIG_HOME}/nvm" nvm install 16.15.1 # NEOVIM -wget https://github.com/neovim/neovim/releases/download/v0.9.5/nvim-linux64.tar.gz -tar xzvf nvim-linux64.tar.gz -sudo ln -s "${INSTALL_DIR}/nvim-linux64/bin/nvim" /usr/local/bin/nvim +wget ${NEOVIM_INSTALLER} +tar xzvf ${NEOVIM_DIR}.tar.gz +sudo ln -s "${INSTALL_DIR}/${NEOVIM_DIR}/bin/nvim" /usr/local/bin/nvim sudo apt-get install -y python3-venv # RIPGREP @@ -83,5 +85,3 @@ fi # exit cd ~ - - From eccc4f2543fe8e5f1ca50a118c4ffc0150dded61 Mon Sep 17 00:00:00 2001 From: Diogo Telheiro do Nascimento <44041957+Diogo364@users.noreply.github.com> Date: Wed, 7 May 2025 13:39:04 -0400 Subject: [PATCH 5/7] Remove CLANG specific features --- install.sh | 7 ------- 1 file changed, 7 deletions(-) diff --git a/install.sh b/install.sh index e7712ee..b0a007d 100755 --- a/install.sh +++ b/install.sh @@ -50,13 +50,6 @@ cd "$INSTALL_DIR" rm -rf "${XDG_CONFIG_HOME}" sudo apt-get update -# CLANG -sudo apt-get install -y clang -sudo ln -s -f .clangd ~/.clangd - -# BEAR -sudo apt-get install -y bear - # XCLIP sudo apt-get install -y xclip From ba5c0b72a5631f25376a5bec68bdedac10732583 Mon Sep 17 00:00:00 2001 From: Diogo Telheiro do Nascimento <44041957+Diogo364@users.noreply.github.com> Date: Wed, 7 May 2025 13:39:41 -0400 Subject: [PATCH 6/7] Add FD for finder feature --- install.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/install.sh b/install.sh index b0a007d..40a77fa 100755 --- a/install.sh +++ b/install.sh @@ -69,6 +69,10 @@ sudo apt-get install -y python3-venv curl -LO https://github.com/BurntSushi/ripgrep/releases/download/13.0.0/ripgrep_13.0.0_amd64.deb sudo apt-get install "./ripgrep_13.0.0_amd64.deb" +# FD +curl -LO https://github.com/sharkdp/fd/releases/download/v10.2.0/fd-musl_10.2.0_amd64.deb +sudo apt-get install "./fd-musl_10.2.0_amd64.deb" + # Git Repository (provided as an argument) if [ -n "$1" ]; then git clone "$1" "${XDG_CONFIG_HOME}/nvim" From 8b3d35edf5a7eb24ae6344ebc60255ca7b11f5b8 Mon Sep 17 00:00:00 2001 From: Diogo Telheiro do Nascimento <44041957+Diogo364@users.noreply.github.com> Date: Wed, 7 May 2025 13:46:56 -0400 Subject: [PATCH 7/7] Changed nvm installation only if not already installed --- install.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/install.sh b/install.sh index 40a77fa..78296ba 100755 --- a/install.sh +++ b/install.sh @@ -54,10 +54,12 @@ sudo apt-get update sudo apt-get install -y xclip # NPM -curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash -export NVM_DIR="${XDG_CONFIG_HOME}/nvm" -[ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm -nvm install 16.15.1 +if ! command -v npm > /dev/null ; then + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.7/install.sh | bash + export NVM_DIR="${XDG_CONFIG_HOME}/nvm" + [ -s "$NVM_DIR/nvm.sh" ] && \. "$NVM_DIR/nvm.sh" # This loads nvm + nvm install 16.15.1 +fi # NEOVIM wget ${NEOVIM_INSTALLER}