# -*- coding: utf-8 -*- import os import sys import subprocess def gen_models(): subprocess.call("flutter packages pub run json_model", stderr=subprocess.STDOUT, shell=True) def gen_splash(): subprocess.call("flutter pub pub run flutter_native_splash:create", stderr=subprocess.STDOUT, shell=True) if __name__ == "__main__": args = sys.argv if len(args) > 1: if args[1] == "gen": gen_models() exit() if args[1] == "splash": gen_splash() exit() elif args[1] == "help": print("用法:\n\ gen\t\t-- 生成 json models\n\ splash\t\t-- 生成 splash files\n\ help\t\t-- 显示帮助文档\n\ ") exit() else: print("参数错误 请使用 help 检查可用的参数列表") else: print("参数错误 请使用 help 检查可用的参数列表")