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