Skip to content

Instantly share code, notes, and snippets.

@masonwan
Last active November 28, 2022 07:43
Show Gist options
  • Save masonwan/f6448d19cc47dc08fc47 to your computer and use it in GitHub Desktop.
Save masonwan/f6448d19cc47dc08fc47 to your computer and use it in GitHub Desktop.
A set of shell scripts to set up
For Gist title
function install-git
echo 'Installing git'
sudo apt-get install -y git
end
if not test -d $HOME
echo 'Create home directory'
sudo mkdir $HOME
sudo chown menghsiw:amazon $HOME
cd $HOME
end
if not test -d $HOME/repos
echo 'Download server setup package'
mkdir $HOME/repos
cd $HOME/repos
if not type git > /dev/null
echo 'Could not find git command. Installing it.'
install-git
end
git clone https://masonwan@bitbucket.org/masonwan/server-setup.git
echo 'Set up fish config'
mkdir -p $HOME/.config/fish
ln -s $HOME/repos/server-setup/fish/config.fish $HOME/.config/fish/config.fish
ln -s $HOME/repos/server-setup/fish/functions $HOME/.config/fish/functions
mkdir -p $HOME/.config/fish/extra
ln -s $HOME/repos/server-setup/fish/extra/fish_user_key_bindings.fish $HOME/.config/fish/extra/fish_user_key_bindings.fish
. $HOME/repos/server-setup/fish/config.fish
end
if not test -f $HOME/.vimrc
echo 'Link vim config'
ln -s $HOME/repos/server-setup/vim/.vimrc $HOME/.vimrc
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment