-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.py
More file actions
26 lines (19 loc) · 682 Bytes
/
Copy pathsetup.py
File metadata and controls
26 lines (19 loc) · 682 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
from pathlib import Path
import subprocess
import os
def update_symlink(source_path: Path, symlink_path: Path) -> None:
assert source_path.exists()
is_dir = source_path.is_dir()
symlink_path.unlink(missing_ok = True)
symlink_path.symlink_to(source_path, is_dir)
def main():
this_path = Path(__file__).parent.resolve()
home_path = Path.home()
# install vim configs
update_symlink(this_path / ".vimrc", home_path / ".vimrc")
update_symlink(this_path / ".vim", home_path / ".vim")
# install .bash_profile
update_symlink(this_path / ".bash_profile", home_path / ".bash_profile")
# print out done message
print("Done!")
main()