Use os instead of redundant definitions in lib.Path

This commit is contained in:
koumakpet 2020-03-14 13:52:59 +01:00
parent 32dce7de6d
commit 0a3665483f

View file

@ -1,4 +1,5 @@
from lib import Input, Print, Install, Path from lib import Input, Print, Install, Path
import os
def make_backup(backup_floder): def make_backup(backup_floder):
@ -33,7 +34,7 @@ def personalized_changes(file):
def init(symlink): def init(symlink):
# Get path to files/ floder (contains all dotfiles) # Get path to files/ floder (contains all dotfiles)
files_dir = Path.join_paths( files_dir = os.path.join(
Path.get_parent(__file__), 'files') Path.get_parent(__file__), 'files')
# Create optional backup # Create optional backup
make_backup(files_dir) make_backup(files_dir)
@ -42,7 +43,7 @@ def init(symlink):
# Make personalized changes to files # Make personalized changes to files
personalized_changes(file) personalized_changes(file)
# Set symlink position ($HOME/filepath) # Set symlink position ($HOME/filepath)
position = Path.join_paths( position = os.path.join(
Path.get_home(), file.replace(f'{files_dir}/', '')) Path.get_home(), file.replace(f'{files_dir}/', ''))
if symlink: if symlink: