Exemple #1
0
def install():
    """ Installs and configures vim """
    # update apt index
    update_index(quiet=False)

    install_dependencies()

    # backup vim configuration folder
    if exists('.vim'):
        print(green('Backing up your vim configuration folder to .vim-bkp'))
        cmd = 'mv .vim .vim-bkp'
        run(cmd)

    # backup vim configuration file
    if exists('.vimrc'):
        print(green('Backing up your vim configuration file to .vimrc-bkp'))
        cmd = 'mv .vimrc .vimrc-bkp'
        run(cmd)

    # clone vim_config repository
    print(green('Cloning Vim_config repository.'))
    # install git if is not available
    git_install()
    git_clone('git://github.com/magnet-cl/Vim_config.git', '.vim')

    # installation script
    print(green('Installing Vim_config.'))
    with cd('.vim'):
        cmd = 'source install.sh'
        run(cmd)
Exemple #2
0
def install():
    """ Installs and sets zsh as default shell """
    # update apt index
    utils.os_commands.update_index(quiet=False)

    # install zsh
    utils.os_commands.install('zsh')

    # set as default shell for the user
    print(green('Re-enter your password to set zsh as default.'))
    with settings(hide('warnings'), warn_only=True):
        cmd = 'chsh -s /bin/zsh %s' % env.user
        while True:  # prompt password until success
            if not run(cmd).failed:
                break
            else:
                print(red('Wrong password, try again.'))

    # install git if is not available
    git_install()

    # install oh-my-zsh
    if not exists('~/.oh-my-zsh'):
        git_clone('git://github.com/robbyrussell/oh-my-zsh.git',
                  '~/.oh-my-zsh')

    # zsh configuration
    configure()
Exemple #3
0
def install():
    """ Installs and sets zsh as default shell """
    # update apt index
    update_index(quiet=False)

    # install zsh
    utils.deb.install('zsh')

    # set as default shell for the user
    print(green('Re-enter your password to set zsh as default.'))
    with settings(hide('warnings'), warn_only=True):
        cmd = 'chsh -s /bin/zsh %s' % env.user
        while True:  # prompt password until success
            if not run(cmd).failed:
                break
            else:
                print(red('Wrong password, try again.'))

    # install git if is not available
    git_install()

    # install oh-my-zsh
    if not exists('~/.oh-my-zsh'):
        git_clone('git://github.com/robbyrussell/oh-my-zsh.git',
                  '~/.oh-my-zsh')

    # zsh configuration
    configure()
Exemple #4
0
def install_db_backups_manager():
    """ Installs project py-db-backup """

    if path_exists('py-db-backup'):
        update_manager = prompt(green('DB backups manager already installed. '
                                      'Would you like to update it?'),
                                default='Yes')
        if update_manager in ('Yes', 'yes', 'Y', 'y'):
            with cd('py-db-backup'):
                git_pull()

        return

    # install git if is not available
    git_install()

    print(green('Cloning py-db-backup repository.'))
    git_clone('git://github.com/magnet-cl/py-db-backup.git', 'py-db-backup')

    print(green('Installing py-db-backup'))
    with cd('py-db-backup'):
        cmd = './install.sh'
        run(cmd)
Exemple #5
0
def install_db_backups_manager():
    """ Installs project py-db-backup """

    if path_exists('py-db-backup'):
        update_manager = prompt(green('DB backups manager already installed. '
                                      'Would you like to update it?'),
                                default='Yes')
        if update_manager in ('Yes', 'yes', 'Y', 'y'):
            with cd('py-db-backup'):
                git_pull()

        return

    # install git if is not available
    git_install()

    print(green('Cloning py-db-backup repository.'))
    git_clone('git://github.com/magnet-cl/py-db-backup.git', 'py-db-backup')

    print(green('Installing py-db-backup'))
    with cd('py-db-backup'):
        cmd = './install.sh'
        run(cmd)
Exemple #6
0
def install():
    """ Installs and configures vim """
    # update apt index
    utils.os_commands.update_index(quiet=False)

    install_dependencies()

    # backup vim configuration folder
    if exists('.vim'):
        base_bkp_name = '.vim-bkp'
        bkp_name = base_bkp_name
        counter = 1
        while exists(bkp_name):
            bkp_name = '{}-{}'.format(base_bkp_name, counter)
        print(
            green('Backing up your vim configuration folder to {}').format(
                bkp_name))
        cmd = 'mv .vim {}'.format(bkp_name)
        run(cmd)

    # backup vim configuration file
    if exists('.vimrc'):
        print(green('Backing up your vim configuration file to .vimrc-bkp'))
        cmd = 'mv .vimrc .vimrc-bkp'
        run(cmd)

    # clone vim_config repository
    print(green('Cloning Vim_config repository.'))
    # install git if is not available
    git_install()
    git_clone('git://github.com/magnet-cl/Vim_config.git', '.vim')

    # installation script
    print(green('Installing Vim_config.'))
    with cd('.vim'):
        cmd = 'source install.sh'
        run(cmd)
Exemple #7
0
def install():
    """ Installs and configures vim """
    # update apt index
    utils.os_commands.update_index(quiet=False)

    install_dependencies()

    # backup vim configuration folder
    if exists('.vim'):
        base_bkp_name = '.vim-bkp'
        bkp_name = base_bkp_name
        counter = 1
        while exists(bkp_name):
            bkp_name = '{}-{}'.format(base_bkp_name, counter)
        print(green('Backing up your vim configuration folder to {}').format(
            bkp_name
        ))
        cmd = 'mv .vim {}'.format(bkp_name)
        run(cmd)

    # backup vim configuration file
    if exists('.vimrc'):
        print(green('Backing up your vim configuration file to .vimrc-bkp'))
        cmd = 'mv .vimrc .vimrc-bkp'
        run(cmd)

    # clone vim_config repository
    print(green('Cloning Vim_config repository.'))
    # install git if is not available
    git_install()
    git_clone('git://github.com/magnet-cl/Vim_config.git', '.vim')

    # installation script
    print(green('Installing Vim_config.'))
    with cd('.vim'):
        cmd = 'source install.sh'
        run(cmd)