Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions archinstall/lib/args.py
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,6 @@
from archinstall.lib.plugins import load_plugin
from archinstall.lib.translationhandler import Language, tr, translation_handler
from archinstall.lib.utils.format import as_key_value_pair
from archinstall.lib.utils.util import is_valid_path
from archinstall.lib.version import get_version
from archinstall.tui.components import tui

Expand Down Expand Up @@ -404,7 +403,7 @@ def save(
) -> None:
save_path = dest_path or DEFAULT_SAVE_PATH

if not is_valid_path(save_path):
if not save_path.is_dir():
warn(
f'Destination directory {save_path} does not exist or is not a directory\n.',
'Configuration files can not be saved',
Expand All @@ -416,7 +415,7 @@ def save(
self.save_user_creds(save_path, password=password)

def save_user_config(self, dest_path: Path) -> None:
if not is_valid_path(dest_path):
if not dest_path.is_dir():
error(f'Invalid path {dest_path}. User configuration could not be saved.')
return

Expand All @@ -430,7 +429,7 @@ def save_user_creds(
dest_path: Path,
password: str | None = None,
) -> None:
if not is_valid_path(dest_path):
if not dest_path.is_dir():
error(f'Invalid path {dest_path}. User credentials could not be saved.')
return

Expand Down
5 changes: 0 additions & 5 deletions archinstall/lib/utils/util.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
import secrets
import string
from datetime import UTC, datetime
from pathlib import Path

from archinstall.lib.pathnames import ARCHISO_MOUNTPOINT
from archinstall.lib.utils.format import as_columns
Expand Down Expand Up @@ -47,7 +46,3 @@ def format_cols(items: list[str], header: str | None = None) -> str:
# remove whitespaces on each row
text = '\n'.join(t.strip() for t in text.split('\n'))
return text


def is_valid_path(path: Path) -> bool:
return path.exists() and path.is_dir()