1#!/usr/bin/env python
2# -*- coding: utf-8 -*-
3# Copyright (c) 2021-2023 Huawei Device Co., Ltd.
4# Licensed under the Apache License, Version 2.0 (the "License");
5# you may not use this file except in compliance with the License.
6# You may obtain a copy of the License at
7#
8#     http://www.apache.org/licenses/LICENSE-2.0
9#
10# Unless required by applicable law or agreed to in writing, software
11# distributed under the License is distributed on an "AS IS" BASIS,
12# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13# See the License for the specific language governing permissions and
14# limitations under the License.
15import sys
16import argparse
17import os
18import shutil
19
20
21def copy_file(src, dst):
22    dest_dir = os.path.dirname(dst)
23    if not os.path.exists(dest_dir):
24        os.makedirs(dest_dir, exist_ok=True)
25    shutil.copy2(src, dst)
26
27
28def main():
29    parser = argparse.ArgumentParser()
30    parser.add_argument('--src-file',
31        help='plugin build config json', required=True)
32    parser.add_argument('--dst-file',
33        help='plugin config json file', required=True)
34    args = parser.parse_args()
35    copy_file(args.src_file, args.dst_file)
36    return 0
37
38
39if __name__ == '__main__':
40    sys.exit(main())
41