From 93ff04c6e23d4ba5f6006925122a0a570e5a9275 Mon Sep 17 00:00:00 2001 From: "Florian RICHER (MrDev023)" Date: Wed, 13 Apr 2022 22:47:36 +0200 Subject: [PATCH] Add run_once scripts for unix (not complete for macosx) --- run_once_prepare_unix.sh.tmpl | 41 +++++++++++++++++++++++++++++++++++ run_once_prepare_windows.ps1 | 15 ++++++++----- 2 files changed, 51 insertions(+), 5 deletions(-) create mode 100644 run_once_prepare_unix.sh.tmpl diff --git a/run_once_prepare_unix.sh.tmpl b/run_once_prepare_unix.sh.tmpl new file mode 100644 index 0000000..0bc6997 --- /dev/null +++ b/run_once_prepare_unix.sh.tmpl @@ -0,0 +1,41 @@ +#!/bin/bash + +# JUST TO KEEP IN HEAD +# {{ if eq .chezmoi.kernel.osrelease "ubuntu" -}} +# sudo apt install ripgrep +# {{ end -}} + +# INSTALL HOMEBREW +bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)" + + +{{ if eq .chezmoi.os "linux" -}} + +echo 'eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)"' >> /home/$USER/.bash_profile +eval "$(/home/linuxbrew/.linuxbrew/bin/brew shellenv)" +# {{ else if eq .chezmoi.os "darwin" -}} +{{ end -}} + + +# INSTALL COMMON PACKAGES WITH HOMEBREW +brew install gcc make cmake gitui neovim tmux lazygit ripgrep fd + +# INSTALL RVM FOR RUBY +curl -sSL https://get.rvm.io | bash -s stable --ruby + +# INSTALL NVM FOR NODE +curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash + +# INSTALL FVM FOR FLUTTER +brew tap leoafarias/fvm +brew install fvm + +# INSTALL RUSTUP WITH STABLE RUST VERSION +curl https://sh.rustup.rs -sSf | sh -s -- -y +brew install rust-analyzer + +{{ if eq .chezmoi.os "linux" -}} + +source ~/.bash_profile +# {{ else if eq .chezmoi.os "darwin" -}} +{{ end -}} \ No newline at end of file diff --git a/run_once_prepare_windows.ps1 b/run_once_prepare_windows.ps1 index a1b1cd1..9560635 100644 --- a/run_once_prepare_windows.ps1 +++ b/run_once_prepare_windows.ps1 @@ -5,10 +5,15 @@ if (-Not ([Security.Principal.WindowsPrincipal] [Security.Principal.WindowsIdent Exit } -$config_folder = "$env:USERPROFILE\.config\gitui" -$symlink_folder = "$env:APPDATA\gitui" -if (Test-Path $symlink_folder) { - Remove-Item -Recurse $symlink_folder +$appDatasToSymlink = 'gitui' +Foreach ($item in $appDatasToSymlink) { + $config_folder = "$env:USERPROFILE\.config\$item" + $symlink_folder = "$env:APPDATA\$item" + if (Test-Path $symlink_folder) { + Remove-Item -Recurse $symlink_folder + } + New-Item -Path $symlink_folder -ItemType SymbolicLink -Value $config_folder } -New-Item -Path $symlink_folder -ItemType SymbolicLink -Value $config_folder \ No newline at end of file +# Install required packages with winget +winget install alacritty