#!/usr/bin/env python3

import os
import sys

current_directory = os.path.dirname(os.path.realpath(__file__))
home_directory = os.getenv('HOME')

def link(source_filename, link_path):
    source_path = os.path.join(current_directory, source_filename)

    try:
        os.symlink(source_path, link_path)
    except OSError:
        print('did not link %s (already exists)' % link_path)
    else:
        print('linked %s to %s' % (source_filename, link_path))

def link_in_home(source_filename, link_relative_path):
    link_path = os.path.join(home_directory, link_relative_path)

    link(source_filename, link_path)

link_in_home('vimrc', '.vimrc')

if sys.platform != 'darwin':
    print('skipping mac-specific steps')

    sys.exit()

link_in_home('settings.json', 'Library/Application Support/Code/User/settings.json')

if not os.path.exists('ubuntu-font-family-0.83.zip'):
    print('installing ubuntu font')

    os.system('curl https://assets.ubuntu.com/v1/0cef8205-ubuntu-font-family-0.83.zip -o ubuntu-font-family-0.83.zip')
    os.system('unzip ubuntu-font-family-0.83.zip ubuntu-font-family-0.83/UbuntuMono-R.ttf -d ~/Library/Fonts/')
else:
    print('did not install ubuntu font (already exists)')

print('writing iterm2 configuration')

os.system('defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/dotfiles/iterm2"')
os.system('defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true')

7e107b15d097ee083e292201a234562953758430
<mask token>


def link(source_filename, link_path):
    source_path = os.path.join(current_directory, source_filename)
    try:
        os.symlink(source_path, link_path)
    except OSError:
        print('did not link %s (already exists)' % link_path)
    else:
        print('linked %s to %s' % (source_filename, link_path))


def link_in_home(source_filename, link_relative_path):
    link_path = os.path.join(home_directory, link_relative_path)
    link(source_filename, link_path)


<mask token>

<mask token>


def link(source_filename, link_path):
    source_path = os.path.join(current_directory, source_filename)
    try:
        os.symlink(source_path, link_path)
    except OSError:
        print('did not link %s (already exists)' % link_path)
    else:
        print('linked %s to %s' % (source_filename, link_path))


def link_in_home(source_filename, link_relative_path):
    link_path = os.path.join(home_directory, link_relative_path)
    link(source_filename, link_path)


link_in_home('vimrc', '.vimrc')
if sys.platform != 'darwin':
    print('skipping mac-specific steps')
    sys.exit()
link_in_home('settings.json',
    'Library/Application Support/Code/User/settings.json')
if not os.path.exists('ubuntu-font-family-0.83.zip'):
    print('installing ubuntu font')
    os.system(
        'curl https://assets.ubuntu.com/v1/0cef8205-ubuntu-font-family-0.83.zip -o ubuntu-font-family-0.83.zip'
        )
    os.system(
        'unzip ubuntu-font-family-0.83.zip ubuntu-font-family-0.83/UbuntuMono-R.ttf -d ~/Library/Fonts/'
        )
else:
    print('did not install ubuntu font (already exists)')
print('writing iterm2 configuration')
os.system(
    'defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/dotfiles/iterm2"'
    )
os.system(
    'defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true'
    )

<mask token>
current_directory = os.path.dirname(os.path.realpath(__file__))
home_directory = os.getenv('HOME')


def link(source_filename, link_path):
    source_path = os.path.join(current_directory, source_filename)
    try:
        os.symlink(source_path, link_path)
    except OSError:
        print('did not link %s (already exists)' % link_path)
    else:
        print('linked %s to %s' % (source_filename, link_path))


def link_in_home(source_filename, link_relative_path):
    link_path = os.path.join(home_directory, link_relative_path)
    link(source_filename, link_path)


link_in_home('vimrc', '.vimrc')
if sys.platform != 'darwin':
    print('skipping mac-specific steps')
    sys.exit()
link_in_home('settings.json',
    'Library/Application Support/Code/User/settings.json')
if not os.path.exists('ubuntu-font-family-0.83.zip'):
    print('installing ubuntu font')
    os.system(
        'curl https://assets.ubuntu.com/v1/0cef8205-ubuntu-font-family-0.83.zip -o ubuntu-font-family-0.83.zip'
        )
    os.system(
        'unzip ubuntu-font-family-0.83.zip ubuntu-font-family-0.83/UbuntuMono-R.ttf -d ~/Library/Fonts/'
        )
else:
    print('did not install ubuntu font (already exists)')
print('writing iterm2 configuration')
os.system(
    'defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/dotfiles/iterm2"'
    )
os.system(
    'defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true'
    )

import os
import sys
current_directory = os.path.dirname(os.path.realpath(__file__))
home_directory = os.getenv('HOME')


def link(source_filename, link_path):
    source_path = os.path.join(current_directory, source_filename)
    try:
        os.symlink(source_path, link_path)
    except OSError:
        print('did not link %s (already exists)' % link_path)
    else:
        print('linked %s to %s' % (source_filename, link_path))


def link_in_home(source_filename, link_relative_path):
    link_path = os.path.join(home_directory, link_relative_path)
    link(source_filename, link_path)


link_in_home('vimrc', '.vimrc')
if sys.platform != 'darwin':
    print('skipping mac-specific steps')
    sys.exit()
link_in_home('settings.json',
    'Library/Application Support/Code/User/settings.json')
if not os.path.exists('ubuntu-font-family-0.83.zip'):
    print('installing ubuntu font')
    os.system(
        'curl https://assets.ubuntu.com/v1/0cef8205-ubuntu-font-family-0.83.zip -o ubuntu-font-family-0.83.zip'
        )
    os.system(
        'unzip ubuntu-font-family-0.83.zip ubuntu-font-family-0.83/UbuntuMono-R.ttf -d ~/Library/Fonts/'
        )
else:
    print('did not install ubuntu font (already exists)')
print('writing iterm2 configuration')
os.system(
    'defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/dotfiles/iterm2"'
    )
os.system(
    'defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true'
    )

#!/usr/bin/env python3

import os
import sys

current_directory = os.path.dirname(os.path.realpath(__file__))
home_directory = os.getenv('HOME')

def link(source_filename, link_path):
    source_path = os.path.join(current_directory, source_filename)

    try:
        os.symlink(source_path, link_path)
    except OSError:
        print('did not link %s (already exists)' % link_path)
    else:
        print('linked %s to %s' % (source_filename, link_path))

def link_in_home(source_filename, link_relative_path):
    link_path = os.path.join(home_directory, link_relative_path)

    link(source_filename, link_path)

link_in_home('vimrc', '.vimrc')

if sys.platform != 'darwin':
    print('skipping mac-specific steps')

    sys.exit()

link_in_home('settings.json', 'Library/Application Support/Code/User/settings.json')

if not os.path.exists('ubuntu-font-family-0.83.zip'):
    print('installing ubuntu font')

    os.system('curl https://assets.ubuntu.com/v1/0cef8205-ubuntu-font-family-0.83.zip -o ubuntu-font-family-0.83.zip')
    os.system('unzip ubuntu-font-family-0.83.zip ubuntu-font-family-0.83/UbuntuMono-R.ttf -d ~/Library/Fonts/')
else:
    print('did not install ubuntu font (already exists)')

print('writing iterm2 configuration')

os.system('defaults write com.googlecode.iterm2.plist PrefsCustomFolder -string "~/dotfiles/iterm2"')
os.system('defaults write com.googlecode.iterm2.plist LoadPrefsFromCustomFolder -bool true')
