ruanwenjun commented on a change in pull request #1636:
URL:
https://github.com/apache/incubator-seatunnel/pull/1636#discussion_r841148627
##########
File path:
seatunnel-core/seatunnel-core-flink/src/main/bin/start-seatunnel-flink.sh
##########
@@ -16,87 +16,24 @@
# limitations under the License.
#
-# copy command line arguments
-
-function usage() {
- echo "Usage: start-seatunnel-flink.sh [options]"
- echo " options:"
- echo " --config, -c FILE_PATH Config file"
- echo " --variable, -i PROP=VALUE Variable substitution, such as -i
city=beijing, or -i date=20190318"
- echo " --check, -t Check config"
- echo " --help, -h Show this help message"
-}
-
-if [[ "$@" = *--help ]] || [[ "$@" = *-h ]] || [[ $# -le 1 ]]; then
- usage
- exit 0
-fi
-
-is_exist() {
- if [ -z $1 ]; then
- usage
- exit 1
- fi
-}
-
-PARAMS=""
-while (( "$#" )); do
- case "$1" in
- -c|--config)
- CONFIG_FILE=$2
- is_exist ${CONFIG_FILE}
- shift 2
- ;;
-
- -i|--variable)
- variable=$2
- is_exist ${variable}
- java_property_value="-D${variable}"
- variables_substitution="${java_property_value} ${variables_substitution}"
- shift 2
- ;;
-
- *) # preserve positional arguments
- PARAMS="$PARAMS $1"
- shift
- ;;
-
- esac
-done
-
-if [ -z ${CONFIG_FILE} ]; then
- echo "Error: The following option is required: [-c | --config]"
- usage
- exit -1
-elif [ ! -f ${CONFIG_FILE} ];then
- echo "Error: Config file ${CONFIG_FILE} does not exists! Please check it."
- exit -1
-fi
-
-# set positional arguments in their proper place
-eval set -- "$PARAMS"
-
-BIN_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
-APP_DIR=$(dirname ${BIN_DIR})
+set -eu
+APP_DIR=$(cd $(dirname ${0})/../;pwd)
CONF_DIR=${APP_DIR}/config
-PLUGINS_DIR=${APP_DIR}/lib
-DEFAULT_CONFIG=${CONF_DIR}/application.conf
-CONFIG_FILE=${CONFIG_FILE:-$DEFAULT_CONFIG}
-
-assemblyJarName=$(find ${PLUGINS_DIR} -name seatunnel-core-flink*.jar)
+APP_JAR=${APP_DIR}/lib/seatunnel-core-flink.jar
if [ -f "${CONF_DIR}/seatunnel-env.sh" ]; then
- source ${CONF_DIR}/seatunnel-env.sh
+ . "${CONF_DIR}/seatunnel-env.sh"
fi
-string_trim() {
- echo $1 | awk '{$1=$1;print}'
-}
-
-JVM_ARGS=$(string_trim "${variables_substitution}")
Review comment:
Yes, it's better to use trim to process the variables. Done.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]