-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathinstall.sh
executable file
·58 lines (49 loc) · 1.4 KB
/
install.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
#!/bin/bash
# Install script for my dotfiles
# Should run by default on linux when the following is installed:
# On osx run
# ./install.sh -osx
# - curl
# - git
# - fish
# - neovim
# Remember the installation directory for further use.
installdir=$(pwd)
# Creates symlink of the first argument to the second argument if the earllier does not exsist.
function symlinkNonExistent {
target=$1
from=$2
# Check if there is already such a file but it's not a symlink. Create backup.
if [ -f $target ] && [ ! -L $target ]; then
mv $target "$target.bckp"
fi
if [ ! -d $(dirname $target) ]; then
mkdir -p $(dirname $target)
fi
# If there is no such file, create symlyink.
if [ ! -f $target ]; then
ln -s "$installdir/$from" $target
fi
}
#if [ "$1" -eq "-osx" ]; then
# if ! grep -q "fish" /etc/shells; then
# echo $(which fish) >> /etc/shells
# chsh -s $(which fish)
# fi
#fi
function main {
# Symlink the config files.
symlinkNonExistent ~/.config/fish/config.fish config.fish
symlinkNonExistent ~/.bashrc .bashrc
symlinkNonExistent ~/.aliasrc .aliasrc
symlinkNonExistent ~/.vimrc .vimrc
symlinkNonExistent ~/.gitconfig .gitconfig
symlinkNonExistent ~/.julia/config/.startup.jl .startup.jl
# Small reminder.
echo "Don't forget to restart the shell!!!"
}
main
#TODO: install fish/omf/other tools?
#TODO install fish clearance theme maybe like so:
#omf theme clearance
#omf install clearance