Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
executable file 64 lines (52 sloc) 2.13 KB
#! /usr/bin/env python
import os, platform, shutil, time
from os.path import exists, join, islink
from subprocess import call
from filecmp import cmp
if exists(join(os.getenv('HOME'), '.rvm')):
print('RVM exists, ignored.')
print('Installing RVM ...')
call('curl -L | bash -s head', shell=True)
call('rvm pkg install zlib', shell=True)
if platform.system() == 'Darwin':
call('rvm install 1.9.3 --with-gcc=clang', shell=True)
call('rvm install 1.9.3', shell=True)
if exists(join(os.getenv('HOME'), '.oh-my-zsh')):
print('oh-my-zsh exists, ignored.')
print('Installing oh-my-zsh ...')
call('curl -L \
| sh', shell=True)
if exists(join(os.getenv('HOME'), '.oh-my-zsh/custom/plugins/zsh-syntax-highlighting')):
print('zsh-syntax-highlighting exists, ignored.')
print('Installing zsh-syntax-highlighting ...')
call('git clone git:// \
~/.oh-my-zsh/custom/plugins/zsh-syntax-highlighting', shell=True)
if exists(join(os.getenv('HOME'), '.vim/janus')) and \
islink(join(os.getenv('HOME'), '.vimrc')):
print('Janus exists, ignored.')
print('Installing Janus ...')
call('curl -Lo- | bash', shell=True)
if exists(join(os.getenv('HOME'), '.dotfiles/zsh/custom')):
print('custom variables file exists, ignored.')
print('Copying custom variables file ...')
call('cp zsh/custom.example zsh/custom', shell=True)
cwd = os.listdir(os.getcwd())
for fname in cwd:
if fname in ['.git', 'install', '']: continue
target_file = join(os.getenv('HOME'), '.%s' % fname)
if exists(target_file):
if cmp(target_file, fname) or islink(target_file):
print('%s is identical, ignored.' % target_file)
shutil.move(target_file, '%s.backup.%s' % (target_file, int(time.time())))
print('%s is backed up.' % target_file)
call('ln -s "$PWD/%(fname)s" "$HOME/.%(fname)s"' % locals(), shell=True)
print('%s is linked.' % fname)
call('source ~/.zshrc', shell=True, executable='/bin/zsh')
Jump to Line
Something went wrong with that request. Please try again.