update install and config files
This commit is contained in:
+35
-28
@@ -6,46 +6,53 @@ from pathlib import Path
|
||||
def sym_link_dir():
|
||||
confirm_link = input("Do you want to link home directories to external storage? (Y/n): ")
|
||||
|
||||
if confirm_link.lower() in ("y", "yes", ""):
|
||||
target_dir = input("Specify the full path to the external storage: ")
|
||||
if confirm_link.lower() not in ("y", "yes", ""):
|
||||
return
|
||||
|
||||
if Path(target_dir).is_dir():
|
||||
for dir in config.DIRECTORIES:
|
||||
DIR_ITEM = Path(f"{Path.home()}/{dir}")
|
||||
target_dir = Path(input("Specify the full path to the external storage: "))
|
||||
|
||||
if not DIR_ITEM.is_symlink():
|
||||
if DIR_ITEM.is_dir():
|
||||
DIR_ITEM.rmdir()
|
||||
DIR_ITEM.symlink_to(f"{target_dir}/{dir}")
|
||||
if not target_dir.is_dir():
|
||||
return
|
||||
|
||||
for dir in config.DIRECTORIES_TO_REMOVE:
|
||||
DIR_ITEM = Path(f"{Path.home()}/{dir}")
|
||||
for subdir in config.DIRECTORIES:
|
||||
dir_item = Path.home() / subdir
|
||||
|
||||
if DIR_ITEM.is_dir() and not DIR_ITEM.is_symlink():
|
||||
DIR_ITEM.rmdir()
|
||||
if not dir_item.is_symlink():
|
||||
if dir_item.is_dir():
|
||||
dir_item.rmdir()
|
||||
dir_item.symlink_to(target_dir / subdir)
|
||||
|
||||
for subdir in config.DIRECTORIES_TO_REMOVE:
|
||||
dir_item = Path.home() / subdir
|
||||
|
||||
if dir_item.is_dir() and not dir_item.is_symlink():
|
||||
dir_item.rmdir()
|
||||
|
||||
|
||||
def install_apps():
|
||||
for app in config.APPS:
|
||||
subprocess.run([
|
||||
'sudo', 'pacman', '-S', f"{app}", '--noconfirm'
|
||||
], check=True)
|
||||
subprocess.run(
|
||||
['sudo', 'pacman', '-S', '--noconfirm', *config.APPS],
|
||||
check=True
|
||||
)
|
||||
|
||||
subprocess.run([
|
||||
"fish", "-c", "fisher install jorgebucaran/nvm.fish"
|
||||
], check=True)
|
||||
subprocess.run(
|
||||
["fish", "-c", "fisher install jorgebucaran/nvm.fish"],
|
||||
check=True
|
||||
)
|
||||
|
||||
subprocess.run([
|
||||
"fish", "-c", "nvm install lts"
|
||||
], check=True)
|
||||
subprocess.run(
|
||||
["fish", "-c", "nvm install lts"],
|
||||
check=True
|
||||
)
|
||||
|
||||
|
||||
def stow_dot_files():
|
||||
dotfiles_root = Path.home()/'.dotfiles'
|
||||
for dotfile in config.DOTFILES:
|
||||
subprocess.run([
|
||||
'stow', '-d', str(dotfiles_root), dotfile, '--adopt'
|
||||
], check=True)
|
||||
dotfiles_root = Path.home() / '.dotfiles'
|
||||
|
||||
subprocess.run(
|
||||
['stow', '-d', str(dotfiles_root), *config.DOTFILES, '--adopt'],
|
||||
check=True
|
||||
)
|
||||
|
||||
subprocess.run(
|
||||
['git', 'checkout', '--', *config.DOTFILES],
|
||||
|
||||
Reference in New Issue
Block a user