1#!/usr/bin/env python3
2
3import os
4import sys
5import getpass
6import shutil
7
8comp_path = sys.path[0]
9print("comp_path:")
10print(comp_path)
11
12# original folder
13org_image_path = comp_path + "/example/image"
14org_font_path = comp_path + "/src/resources/font"
15
16# new folder
17data_path = comp_path + "/../../hardware/chip/haas1000/prebuild/data"
18image_path = data_path + "/ugraphics_image"
19font_path = data_path + "/font"
20
21# delete prebuild/data resources
22if os.path.exists(image_path):
23    print ('Delete /data/ugraphics_image firstly')
24    shutil.rmtree(image_path)
25
26if os.path.exists(font_path):
27    print ('Delete /data/font firstly')
28    shutil.rmtree(font_path)
29
30# copy resources
31shutil.copytree(org_image_path, image_path)
32shutil.copytree(org_font_path, font_path)
33
34# result
35print("run external script success")
36