-
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
b4a7b4e
commit bed5d78
Showing
1 changed file
with
29 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -390,9 +390,36 @@ def install_zsh_plugins(dry_run: bool = DRY_RUN) -> None: | |
print("Simulating ZSH plugins installation...") | ||
|
||
|
||
def setup_dotfiles() -> None: | ||
def setup_dotfiles(dry_run: bool = DRY_RUN) -> None: | ||
"""Set up dotfiles for the system.""" | ||
pass | ||
dotfiles_dir = Path(f"{Path.home()}/.dotfiles") | ||
|
||
if not dry_run: | ||
# INFO: Create the "~/.dotfiles" directory if it doesn't already exists | ||
if not dotfiles_dir.exists() and not dotfiles_dir.is_dir(): | ||
Path.mkdir(dotfiles_dir) | ||
|
||
# INFO: Attempt to download the dotfiles from the remote repository on GitHub | ||
try: | ||
subprocess.run( | ||
["git", "clone", "[email protected]:Jarmos-san/dotfiles", dotfiles_dir] | ||
) | ||
except subprocess.CalledProcessError as error: | ||
print(error) | ||
|
||
# INFO: Check if the contents of the ".dotfiles" repository are already | ||
# symlinked, if yes then attempt to remove the links | ||
for content in Path.iterdir(dotfiles_dir / "dotfiles"): | ||
if content.is_symlink(): | ||
content.unlink(missing_ok=True) | ||
|
||
# INFO: Create symlinks of the contents from "~/.dotfiles/dotfiles" directory | ||
for content in Path.iterdir(dotfiles_dir / "dotfiles"): | ||
content.symlink_to( | ||
target=f"{Path.home()}/{content}", target_is_directory=True | ||
) | ||
else: | ||
print("Simulating dotfiles setup...") | ||
|
||
|
||
def install_docker() -> None: | ||
|