Beispiel #1
0
def ensure_python_pkg(name):
    if not program_exists("pip"):
        if program_exists("easy_install"):
            sudo("easy_install pip")
        else:
            ensure_package("python-pip")
    sudo("pip install %s" % name)
Beispiel #2
0
def find_package_management_program():
    if env.get("install_package_command"):
        return
    if is_linux():
        if program_exists("apt-get"):
            env.install_package_command = "sudo apt-get install -y"
        elif program_exists("yum"):
            env.install_package_command = "sudo yum -y install"
    elif is_macos():
        ensure_homebrew()
        env.install_package_command = "brew install"
Beispiel #3
0
def zsh():
    if not program_exists('zsh'):
        ensure_package('zsh')
    ensure_git_repo('~/.oh-my-zsh', 'git://github.com/yejianye/oh-my-zsh.git', pushurl='[email protected]:yejianye/oh-my-zsh.git')
    ensure_link('.zshrc_common', 'configs/.zshrc_common')
    ensure_file('.zshrc', append='source ~/.zshrc_common')
    ensure_file('.zshenv', append=['setopt ALL_EXPORT'])
    ensure_dir('~/bin')
    ensure_git_repo('~/utils', 'git://github.com/yejianye/util-scripts.git', pushurl='[email protected]:yejianye/util-scripts.git')
    ensure_bin_path(['.', '~/bin', '~/utils', '/usr/local/bin'])
Beispiel #4
0
def ensure_git_repo(path, url, pushurl=None, submodules=False):
	if not exists(path):
		if not program_exists('git'):
			ensure_package('git')
		run('git clone %s %s' % (url, path))
		if pushurl:
			with(cd(path)):
				run('git config remote.origin.pushurl %s' % pushurl)
		if submodules:
			with(cd(path)):
				run('git submodule init')
				run('git submodule update')
Beispiel #5
0
def tmux():
    ensure_package('tmux')
    ensure_link('.tmux.conf', 'configs/.tmux.conf')
    if is_macos():
        if not program_exists('reattach-to-user-namespace'):
            ensure_git_repo('/tmp/reattach-to-user-namespace', 'git://github.com/ChrisJohnsen/tmux-MacOSX-pasteboard.git')
            with cd('/tmp/reattach-to-user-namespace'):
                run('make reattach-to-user-namespace')
                run('cp reattach-to-user-namespace ~/bin')
        ensure_link('.tmux.platform.conf', 'configs/.tmux.mac.conf')
    else:
        ensure_file('.tmux.platform.conf')
    ensure_ruby_pkg('tmuxinator')
Beispiel #6
0
def ensure_ruby_pkg(name):
    if not program_exists("gem"):
        ensure_package("ruby")
    sudo("gem install %s" % name)
Beispiel #7
0
def ensure_nodejs_pkg(name):
    if not program_exists("npm"):
        ensure_package("nodejs")
    sudo("npm install -g %s" % name)
Beispiel #8
0
def ensure_homebrew():
    if not program_exists("brew"):
        run(
            '/usr/bin/ruby -e "$(/usr/bin/curl -fksSL https://raw.github.com/mxcl/homebrew/master/Library/Contributions/install_homebrew.rb)"'
        )