1 Star 0 Fork 3.2K

林建武/interface_sdk-js

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
remove_internal.py 1.66 KB
一键复制 编辑 原始数据 按行查看 历史
houhaoyu 提交于 2022-03-30 07:52 . houhaoyu@huawei.com
#!/usr/bin/env python
# -*- coding: utf-8 -*-
# Copyright (c) 2021-2022 Huawei Device Co., Ltd.
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
import os
import sys
import optparse
import shutil
# d.ts directories to be deleted
remove_list = ["@internal", "common", "form", "liteWearable", "config", "syscapCheck"]
# traversal all fill in project folder
def copy_files(input_path, output_path):
for file in os.listdir(input_path):
src = os.path.join(input_path, file)
dst = os.path.join(output_path, file)
if os.path.isdir(src) and (not file in remove_list):
shutil.copytree(src, dst, dirs_exist_ok=True)
elif os.path.isfile(src):
shutil.copy(src, dst)
def parse_args(args):
parser = optparse.OptionParser()
parser.add_option('--input', help='d.ts document input path')
parser.add_option('--output', help='d.ts document output path')
options, _ = parser.parse_args(args)
return options
def main(argv):
options = parse_args(argv)
if not os.path.exists(options.output):
os.makedirs(options.output)
copy_files(options.input, options.output)
if __name__ == "__main__":
exit(main(sys.argv))
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/lin-jianwu/interface_sdk-js.git
git@gitee.com:lin-jianwu/interface_sdk-js.git
lin-jianwu
interface_sdk-js
interface_sdk-js
master

搜索帮助