🏗 update scripts to work on ubuntu

This commit is contained in:
James Walker 2020-11-02 20:07:39 -05:00
parent b3bb7ea3ff
commit a43cc8ce5c
Signed by: walkah
GPG Key ID: 3C127179D6086E93
5 changed files with 93 additions and 40 deletions

View File

@ -13,4 +13,4 @@ set -g status-fg white
bind-key X kill-session bind-key X kill-session
set-option -g default-command "reattach-to-user-namespace -l zsh" #set-option -g default-command "reattach-to-user-namespace -l zsh"

View File

@ -15,6 +15,11 @@ export CVS_RSH=ssh
[ -f $HOME/.environment ] && . $HOME/.environment [ -f $HOME/.environment ] && . $HOME/.environment
# Load asdf # Load asdf
if [ type brew &> /dev/null ]; then
. $(brew --prefix asdf)/asdf.sh . $(brew --prefix asdf)/asdf.sh
else
. ~/.asdf/asdf.sh
fi
[ -e $HOME/.nix-profile/etc/profile.d/nix.sh ] && . $HOME/.nix-profile/etc/profile.d/nix.sh [ -e $HOME/.nix-profile/etc/profile.d/nix.sh ] && . $HOME/.nix-profile/etc/profile.d/nix.sh

View File

@ -39,6 +39,7 @@ case "$OSTYPE" in
;; ;;
linux*) linux*)
plugins=($plugins debian) plugins=($plugins debian)
export PATH=/snap/bin:$PATH
;; ;;
esac esac
@ -52,10 +53,12 @@ if [ -d ~/Library/Android/sdk ]; then
fi fi
# zsh autosuggestions # zsh autosuggestions
if [ type brew &> /dev/null ]; then
zsh_autosuggestions=$(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh zsh_autosuggestions=$(brew --prefix)/share/zsh-autosuggestions/zsh-autosuggestions.zsh
if [ -f $zsh_autosuggestions ]; then if [ -f $zsh_autosuggestions ]; then
source $zsh_autosuggestions source $zsh_autosuggestions
fi fi
fi
if [ $TERM = "screen" ]; then if [ $TERM = "screen" ]; then
export DISABLE_AUTO_TITLE="true" export DISABLE_AUTO_TITLE="true"

View File

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
function install_latest() { function install_latest() {
version=$(asdf list-all $1 | grep -v '[a-z]' | tail -1) version=$(asdf list-all $1 | grep -v '[a-z]' | tail -1)
@ -10,6 +10,8 @@ echo "* Updating homesick..."
homesick pull homesick pull
homesick symlink homesick symlink
case "$OSTYPE" in
darwin*)
echo "* Restoring mackup..." echo "* Restoring mackup..."
mackup restore mackup restore
@ -19,6 +21,15 @@ brew upgrade
echo "* Upgrading mac app store apps..." echo "* Upgrading mac app store apps..."
mas upgrade mas upgrade
;;
linux*)
sudo apt update && sudo apt upgrade
sudo snap refresh
;;
esac
echo "* asdf update..." echo "* asdf update..."
export R_CONFIGURE_OPTIONS="--with-x=no" export R_CONFIGURE_OPTIONS="--with-x=no"

View File

@ -1,5 +1,27 @@
#!/bin/bash #!/bin/bash
add_omz() {
if [ ! -d ~/.oh-my-zsh ]; then
echo "Installing oh-my-zsh..."
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
chsh -s /bin/zsh
else
echo "Oh-My-Zsh already installed."
fi
}
add_homesick() {
if [ ! -d ~/.homesick ]; then
echo "Installing homesick..."
homesick clone https://github.com/walkah/dotfiles.git
homesick symlink
else
echo "Homesick already installed."
fi
}
install_macos() {
if [ ! -x "$(command -v git)" ]; then if [ ! -x "$(command -v git)" ]; then
echo "Installing xcode commandline tools..." echo "Installing xcode commandline tools..."
sudo xcode-select --install sudo xcode-select --install
@ -12,22 +34,34 @@ else
echo "Homebrew already installed." echo "Homebrew already installed."
fi fi
if [ ! -d ~/.oh-my-zsh ]; then add_omz
echo "Installing oh-my-zsh..."
git clone https://github.com/robbyrussell/oh-my-zsh.git ~/.oh-my-zsh
chsh -s /bin/zsh
else
echo "Oh-My-Zsh already installed."
fi
if [ ! -d ~/.homesick ]; then
echo "Installing homesick..."
sudo gem install homesick sudo gem install homesick
homesick clone https://github.com/walkah/dotfiles.git add_homesick
homesick symlink
else
echo "Homesick already installed."
fi
echo "Initial brew bundle..." echo "Initial brew bundle..."
brew bundle --global brew bundle --global
}
install_linux() {
sudo apt install zsh curl git homesick
sudo snap install starship
add_omz
add_homesick
if [ ! -d ~/.asdf ]; then
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.0
fi
}
# Actual installer
case "$OSTYPE" in
darwin*)
install_macos
;;
linux*)
install_linux
;;
esac