3 # Copyright (c) 2020 Samsung Electronics Co., Ltd. All Rights Reserved
5 # Licensed under the Apache License, Version 2.0 (the "License");
6 # you may not use this file except in compliance with the License.
7 # You may obtain a copy of the License at
9 # http://www.apache.org/licenses/LICENSE-2.0
11 # Unless required by applicable law or agreed to in writing, software
12 # distributed under the License is distributed on an "AS IS" BASIS,
13 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 # See the License for the specific language governing permissions and
15 # limitations under the License.
17 DRIVER_PATH="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
21 echo "Usage: one-import [FRAMEWORK] ..."
22 echo "Available FRAMEWORK drivers:"
24 for file in "$DRIVER_PATH"/one-import-*;
26 framework_driver=$(basename $file)
27 framework=${framework_driver:11} # 11 is length of "one-import-"
31 if [ $framework_exist == 0 ]; then
32 echo " (There is no available import drivers)"
40 $DRIVER_PATH/one-version one-import-tf
44 # Get command from command-line
46 if [[ -z ${FRAMEWORK} ]]; then
51 if [ ${FRAMEWORK} = "--version" ]; then
55 FRAMEWORK_DRIVER="one-import-$FRAMEWORK"
57 FRAMEWORK_DRIVER_CMD="${DRIVER_PATH}/${FRAMEWORK_DRIVER}"
59 if [[ ! -f "${FRAMEWORK_DRIVER_CMD}" ]]; then
60 echo "ERROR: '${FRAMEWORK_DRIVER}' is not supported"
64 "${FRAMEWORK_DRIVER_CMD}" "$@"