-
Notifications
You must be signed in to change notification settings - Fork 4
/
setup.py
executable file
·28 lines (23 loc) · 1017 Bytes
/
setup.py
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
#!/usr/bin/env python
import os
def installFile(filename, dest):
source = os.path.abspath(os.path.join(dotfilesdir, filename))
destination = os.path.abspath(os.path.join(dest, '.'+filename[:-8]))
print 'Installing ' + destination
if os.path.islink(destination):
print ' Removing old symlink: ' + destination
os.remove(destination)
elif os.path.exists(destination):
print ' Backing up old file: ' + destination + ' to ' + destination + '.bak'
os.rename(destination, destination + '.bak')
os.symlink(source, destination)
dotfilesdir = os.getcwd()
# Install oh-my-zsh if it doesnt already exist
#if not os.path.exists(os.path.join(os.environ["HOME"], '.oh-my-zsh')):
# print 'Installing oh-my-zsh'
# os.system('curl -L https://github.com/robbyrussell/oh-my-zsh/raw/master/tools/install.sh | sh')
# Install every file that ends with '.install'
for dotfile in os.listdir(dotfilesdir):
if dotfile[-8:] == ".install":
installFile(dotfile, os.environ["HOME"])
# vim: set ft=python