fix python errors
This commit is contained in:
@@ -1,4 +1,5 @@
|
|||||||
from pathlib import Path
|
from pathlib import Path
|
||||||
|
import subprocess
|
||||||
|
|
||||||
def sym_link_folders() -> void:
|
def sym_link_folders() -> void:
|
||||||
target_folder = input("Specify the path to the target folder (full path must be used): ")
|
target_folder = input("Specify the path to the target folder (full path must be used): ")
|
||||||
@@ -13,7 +14,14 @@ def sym_link_folders() -> void:
|
|||||||
]
|
]
|
||||||
|
|
||||||
for folder in FOLDERS:
|
for folder in FOLDERS:
|
||||||
Path(f"/run/media/1TB/{folder}").symlink_to(f"~/{folder}")
|
if Path(f"{Path.home()}/{folder}").is_dir() and not Path(f"{Path.home()}/{folder}").is_symlink():
|
||||||
|
Path(f"{Path.home()}/{folder}").rmdir()
|
||||||
|
Path(f"{Path.home()}/{folder}").symlink_to(f"{target_folder}/{folder}")
|
||||||
|
|
||||||
|
if Path(f"{Path.home()}/Templates").is_dir():
|
||||||
|
Path(f"{Path.home()}/Templates").rmdir()
|
||||||
|
if Path(f"{Path.home()}/Public").is_dir():
|
||||||
|
Path(f"{Path.home()}/Public").rmdir()
|
||||||
|
|
||||||
def install_apps() -> void:
|
def install_apps() -> void:
|
||||||
APPS = [
|
APPS = [
|
||||||
@@ -32,16 +40,20 @@ def install_apps() -> void:
|
|||||||
]
|
]
|
||||||
|
|
||||||
for app in APPS:
|
for app in APPS:
|
||||||
subprocess.run(['sudo', 'pacman', '-S', {app}, '--noconfirm'])
|
subprocess.run(['sudo', 'pacman', '-S', f"{app}", '--noconfirm'])
|
||||||
|
|
||||||
subprocess.run(['fisher', 'install', 'jorgebucaran/nvm.fish'])
|
subprocess.run([
|
||||||
subprocess.run(['nvm', 'install', 'lts'])
|
"fish", "-c", "fisher install jorgebucaran/nvm.fish"
|
||||||
|
], check=True)
|
||||||
|
|
||||||
|
subprocess.run([
|
||||||
|
"fish", "-c", "nvm install lts"
|
||||||
|
], check=True)
|
||||||
|
|
||||||
def stow_dot_files() -> void:
|
def stow_dot_files() -> void:
|
||||||
DOTFILES = [
|
DOTFILES = [
|
||||||
'bash',
|
'alacritty',
|
||||||
'konsole',
|
'fish',
|
||||||
'menus',
|
|
||||||
'nvim',
|
'nvim',
|
||||||
'rtorrent',
|
'rtorrent',
|
||||||
'tmux',
|
'tmux',
|
||||||
@@ -49,7 +61,7 @@ def stow_dot_files() -> void:
|
|||||||
]
|
]
|
||||||
|
|
||||||
for dotfile in DOTFILES:
|
for dotfile in DOTFILES:
|
||||||
subprocess.run(['stow', {dotfile}, '--adopt'])
|
subprocess.run(['stow', f"{dotfile}", '--adopt'])
|
||||||
|
|
||||||
subprocess.run(['git', 'checkout', '--', '.'])
|
subprocess.run(['git', 'checkout', '--', '.'])
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user