From c1cdca88c3dc8fac3b7e79b29b87362124287c3b Mon Sep 17 00:00:00 2001 From: Aaron Lichtman Date: Sun, 28 Oct 2018 04:15:39 -0500 Subject: [PATCH] Fix font reinstallation (#151) Close #145 --- shallow_backup/reinstall.py | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/shallow_backup/reinstall.py b/shallow_backup/reinstall.py index 3a3f0383..264b103c 100644 --- a/shallow_backup/reinstall.py +++ b/shallow_backup/reinstall.py @@ -1,6 +1,6 @@ import os +from colorama import Fore from shutil import copytree, copyfile -from colorama import Fore, Style from config import get_config from utils import home_prefix from utils import run_cmd, get_abs_path_subfiles @@ -33,8 +33,10 @@ def reinstall_fonts_sb(fonts_path): print_section_header("REINSTALLING FONTS", Fore.BLUE) # Copy every file in fonts_path to ~/Library/Fonts for font in get_abs_path_subfiles(fonts_path): - # TODO: This doesn't work for some reason. (#145) - copyfile(font, os.path.join("~/Library/Fonts", font.split("/")[-1])) + home_path = os.path.expanduser('~') + font_lib_path = os.path.join(home_path, "Library/Fonts") + dest_path = os.path.join(font_lib_path, font.split("/")[-1]) + copyfile(font, dest_path) print_section_header("FONT REINSTALLATION COMPLETED", Fore.BLUE)