-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsetup.py
More file actions
executable file
·34 lines (24 loc) · 782 Bytes
/
Copy pathsetup.py
File metadata and controls
executable file
·34 lines (24 loc) · 782 Bytes
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
#!/usr/bin/env python
'''
Script must be run from within directory where it's located
so that working directory is correct.
'''
import os
wd = os.getcwd()
home = os.path.expanduser('~')
def symlink_dotfiles():
'''
NOTE- THIS WILL ERASE DOTFILES IN YOUR CURRENT HOME DIRECTORY!!!
Make symbolic links for each file and put them in the home directory
'''
dotfiles = wd + os.sep + 'dotfiles'
for f in os.listdir(dotfiles):
src = dotfiles + os.sep + f
dst = home + os.sep + '.' + f
if os.path.isfile(dst) or os.path.islink(dst):
#print('removing {}'.format(dst))
os.remove(dst)
os.symlink(src, dst)
#print('linking to new {}'.format(dst))
if __name__ == '__main__':
symlink_dotfiles()