import os import shutil import sys def copy_files(product): cur_dir = os.path.curdir google_services_path = f"{cur_dir}/productConfig/{product}/google-services.json" herosdkcfg_path = f"{cur_dir}/productConfig/{product}/herosdkcfg.xml" unityForXcodeConfig_path = f"{cur_dir}/productConfig/{product}/UnityForXcodeConfig.json" hero_BDC_path = f"{cur_dir}/productConfig/{product}/Hero-BDC.asset" google_services_target_dir = f"{cur_dir}/pandora/Assets/" herosdkcfg_target_dir = f"{cur_dir}/pandora/Assets/Plugins/Android/assets" unityForXcodeConfig_dir = f"{cur_dir}/pandora/Assets/Plugins/IOS/HeroUSDKForIOS" hero_BDC_dir = f"{cur_dir}/pandora/Assets/Resources/" if not os.path.exists(google_services_target_dir) or not os.path.exists(herosdkcfg_target_dir): print("Error: dir not exist!") sys.exit(1) shutil.copy(google_services_path, google_services_target_dir) shutil.copy(herosdkcfg_path, herosdkcfg_target_dir) shutil.copy(unityForXcodeConfig_path, unityForXcodeConfig_dir) shutil.copy(hero_BDC_path, hero_BDC_dir) if __name__ == "__main__": if len(sys.argv) != 2: print("Error: copy product config should has parameter!") sys.exit(1) product = sys.argv[1] copy_files(product)