• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2#
3# Copyright (c) 2020 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.
15#
16set -e
17
18echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
19date +%F' '%H:%M:%S
20echo $@
21
22BASE_HOME=$(cd $(dirname $0);pwd)
23RET=0
24
25do_make()
26{
27    pushd ${BASE_HOME}/src
28        if [[ -f "${BASE_HOME}/python/bin/python3" ]]; then
29            python_filepath="${BASE_HOME}/python/bin/python3"
30        elif [[ -f "${BASE_HOME}/../../prebuilts/python/linux-x86/3.8.5/bin/python3" ]]; then
31            python_filepath="${BASE_HOME}/../../prebuilts/python/linux-x86/3.8.5/bin/python3"
32        else
33            python_filepath="python3"
34        fi
35
36        ${python_filepath} -m main "$@"
37        if [ "$?" != 0 ]; then
38            echo "main failed!"
39            $RET=1
40        fi
41    popd
42}
43
44main()
45{
46    do_make "$@"
47    exit $RET
48}
49
50main "$@"
51
52date +%F' '%H:%M:%S
53echo "+++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++"
54