1
+ #! /usr/bin/env bash
2
+ #
3
+ # Licensed to the Apache Software Foundation (ASF) under one or more
4
+ # contributor license agreements. See the NOTICE file distributed with
5
+ # this work for additional information regarding copyright ownership.
6
+ # The ASF licenses this file to You under the Apache License, Version 2.0
7
+ # (the "License"); you may not use this file except in compliance with
8
+ # the License. You may obtain a copy of the License at
9
+ #
10
+ # http://www.apache.org/licenses/LICENSE-2.0
11
+ #
12
+ # Unless required by applicable law or agreed to in writing, software
13
+ # distributed under the License is distributed on an "AS IS" BASIS,
14
+ # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ # See the License for the specific language governing permissions and
16
+ # limitations under the License.
17
+ #
18
+ # Referred from Apache Submarine's common.sh implementation
19
+ # bin/common.sh
20
+
21
+ set -e
22
+
23
+ if [ -L " ${BASH_SOURCE-$0 } " ]; then
24
+ FWDIR=$( dirname " $( readlink " ${BASH_SOURCE-$0 } " ) " )
25
+ else
26
+ FWDIR=$( dirname " ${BASH_SOURCE-$0 } " )
27
+ fi
28
+
29
+ FWDIR=$(
30
+ cd " $FWDIR " || exit 2
31
+ pwd
32
+ )
33
+
34
+ ROOT_DIR=$( dirname " $FWDIR " )
35
+ ROOT_DIR=$(
36
+ cd " $ROOT_DIR " || exit 2
37
+ pwd
38
+ )
39
+
40
+ . " ${FWDIR} /common.sh"
41
+
42
+ CLI_JAR=$( find " $ROOT_DIR /libs" -name " gravitino-cli-*-incubating-SNAPSHOT.jar" 2> /dev/null)
43
+ VERSION=$( basename " $CLI_JAR " | grep -o ' [0-9]\+\.[0-9]\+\.[0-9]\+' )
44
+ if [ -z " $CLI_JAR " ]; then
45
+ echo " Could not find CLI jar in $ROOT_DIR /libs "
46
+ exit 1
47
+ fi
48
+
49
+
50
+ echo " Find CLI jar version: $VERSION "
51
+ java -jar " $CLI_JAR " " $@ "
0 commit comments