1#!/usr/bin/env bash 2 3# Copyright (c) 2025 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 16# This script will replace the old paths with the new ones in all files within the testcases directory. 17 18set -eo pipefail 19 20SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" 21 22# Check if the 'ets' directory exists in SCRIPT_DIR 23if [ ! -d "${SCRIPT_DIR}/ets" ]; then 24 echo "Error: 'ets' directory not found in ${SCRIPT_DIR}." 25 echo "Please make sure the 'ets' directory exists before running bindings test." 26 exit 1 27fi 28 29RESTORE_MODE=0 30if [ "$1" == "--restore" ]; then 31 RESTORE_MODE=1 32fi 33 34if [ $RESTORE_MODE -eq 1 ]; then 35 rm "${SCRIPT_DIR}/../ets2panda" 36 echo 'Remove the symbolic link to ets2panda' 37else 38 ln -s "${SCRIPT_DIR}/ets/ets1.2/build-tools/ets2panda" "${SCRIPT_DIR}/../ets2panda" 39 echo 'Create a symbolic link to ets2panda' 40fi 41 42exit 0 43