forked from supermitch/dotfiles
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathfresher.py
executable file
·64 lines (49 loc) · 1.58 KB
/
fresher.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
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#!/usr/bin/env python
""" This program installs everything you need to make a computer not suck. """
import os
import subprocess
def create_folders():
""" Create common folders """
home = os.path.expanduser('~')
folders = ['.vim']
for folder in folders:
dir_name = os.path.join(home, folder) # New symlink
if os.path.exists(dir_name):
print('\tDir exists - skipped {}'.format(dir_name))
else:
os.makedirs(dir_name)
print('\tMade dir {}'.format(dir_name))
def git_clones():
""" Clones git modules to install various stuff. """
git_repos = [ # (from url, to folder),
('gmarik/Vundle.vim.git', '~/.vim/bundle/Vundle.vim'),
]
for repo, to_folder in git_repos:
if to_folder.startswith('~'): # Expand home if required
to_path = os.path.expanduser(to_folder)
print('\t' + repo)
subprocess.call(['git', 'clone','[email protected]:' + repo, to_path])
def brew():
""" Brew install packages """
pass
def bew_cake():
""" Brew cake install packages """
pass
def misc():
""" Random odds & ends """
sources = ['~/.zshrc']
for source in sources:
source = os.path.expanduser(source)
print(source)
subprocess.call(['bin/sh/', source]) # Source RC files
subprocess.call(['vi', '-c',':PluginInstall']) # Run Vundle
def main():
""" Make it so """
print('Creating folders')
create_folders()
print('Cloning git repos')
git_clones()
print('Miscellaneous')
misc()
if __name__ == '__main__':
main()