From e27c2059eac04ec4a0e5f5303dd9a21a580cae18 Mon Sep 17 00:00:00 2001 From: Anand Doshi Date: Sat, 23 Jul 2016 17:30:53 +0530 Subject: [PATCH] [fix] setup fonts - exit if backup already exists --- bench/utils.py | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/bench/utils.py b/bench/utils.py index a94fd93c..289bf885 100755 --- a/bench/utils.py +++ b/bench/utils.py @@ -615,10 +615,13 @@ def get_bench_name(bench_path): def setup_fonts(): fonts_path = os.path.join('/tmp', 'fonts') + if os.path.exists('/etc/fonts_backup'): + return + exec_cmd("git clone https://github.com/frappe/fonts.git", cwd='/tmp') - os.rename('/usr/share/fonts', '/usr/share/fonts_backup') os.rename('/etc/fonts', '/etc/fonts_backup') - os.rename(os.path.join(fonts_path, 'usr_share_fonts'), '/usr/share/fonts') + os.rename('/usr/share/fonts', '/usr/share/fonts_backup') os.rename(os.path.join(fonts_path, 'etc_fonts'), '/etc/fonts') + os.rename(os.path.join(fonts_path, 'usr_share_fonts'), '/usr/share/fonts') shutil.rmtree(fonts_path) exec_cmd("fc-cache -fv")