2
0
mirror of https://github.com/frappe/bench.git synced 2025-01-10 09:02:10 +00:00

[fix] setup fonts - exit if backup already exists

This commit is contained in:
Anand Doshi 2016-07-23 17:30:53 +05:30
parent e825a0b639
commit e27c2059ea

View File

@ -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")