mirror of
https://github.com/ItsDrike/dotfiles.git
synced 2025-06-30 04:20:43 +00:00
OOP: Added make_backup() method
This commit is contained in:
parent
68a58ca9ca
commit
61c44e1a76
2 changed files with 39 additions and 1 deletions
12
util/Path.py
12
util/Path.py
|
@ -4,6 +4,8 @@ import pathlib
|
|||
|
||||
from util import Command, Print
|
||||
|
||||
WORKING_FLODER = os.path.dirname(os.path.realpath(__file__))
|
||||
|
||||
|
||||
def check_dir_exists(paths):
|
||||
'''Check for directory/ies existence
|
||||
|
@ -145,3 +147,13 @@ def copy(path, copied_path):
|
|||
ensure_dirs(copied_path, file_end=True)
|
||||
Command.execute(f'cp {path} {copied_path}')
|
||||
Print.comment(f'Copied {path} to {copied_path}')
|
||||
|
||||
|
||||
def join(*paths):
|
||||
'''Join paths together
|
||||
(This function is here to avoid re-importing os module in other scripts)
|
||||
|
||||
Returns:
|
||||
str -- Joined paths
|
||||
'''
|
||||
return os.path.join(paths)
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue