Merge "simplified an assertion."
[cli.git] / deployment / zip / src / main / release / bin / oclip.sh
1 #!/bin/bash
2
3 #*******************************************************************************
4 # Copyright 2017 Huawei Technologies Co., Ltd.
5 #
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # 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
19 if [ -z "$OPEN_CLI_HOME" ]
20 then
21     echo "OPEN_CLI_HOME is not set."
22     exit 1
23 fi
24
25 if [ "$OSTYPE" = "msys" ]
26 then
27     SEP=\;
28 else
29     SEP=:
30 fi
31
32 CLASSPATH=${OPEN_CLI_HOME}/conf${SEP}${OPEN_CLI_HOME}${SEP}${OPEN_CLI_HOME}/docs
33 export PATH=$OPEN_CLI_HOME/bin:$PATH
34
35 for entry in "$OPEN_CLI_HOME/lib"/*
36 do
37   CLASSPATH=${CLASSPATH}${SEP}${entry}
38 done
39
40 if [ "$OPEN_CLI_DEBUG" = "true" ]
41 then
42     java -Xdebug -Xrunjdwp:transport=dt_socket,address=${OPEN_CLI_DEBUG_PORT:-5005},server=y -classpath $CLASSPATH -DOPEN_CLI_HOME=$OPEN_CLI_HOME org.onap.cli.main.OnapCli "$@"
43 else
44     java -classpath $CLASSPATH -DOPEN_CLI_HOME=$OPEN_CLI_HOME org.onap.cli.main.OnapCli "$@"
45 fi