mirror of
https://github.com/frappe/bench.git
synced 2025-01-10 00:37:51 +00:00
[fix] setup fonts - exit if backup already exists
This commit is contained in:
parent
e825a0b639
commit
e27c2059ea
@ -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")
|
||||
|
Loading…
Reference in New Issue
Block a user