You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@seatunnel.apache.org by ki...@apache.org on 2022/01/18 12:15:11 UTC
[incubator-seatunnel] branch dev updated: scriptfix (#1053)
This is an automated email from the ASF dual-hosted git repository.
kirs pushed a commit to branch dev
in repository https://gitbox.apache.org/repos/asf/incubator-seatunnel.git
The following commit(s) were added to refs/heads/dev by this push:
new eb078c3 scriptfix (#1053)
eb078c3 is described below
commit eb078c3c9bfcd6595d3e91369c94db3da7276b3b
Author: Simon <36...@qq.com>
AuthorDate: Tue Jan 18 20:15:02 2022 +0800
scriptfix (#1053)
---
bin/start-seatunnel-sql.sh | 9 +++++++++
.../src/main/bin/start-seatunnel-flink.sh | 9 +++++++++
.../src/main/bin/start-seatunnel-spark.sh | 14 +++++++++++---
3 files changed, 29 insertions(+), 3 deletions(-)
diff --git a/bin/start-seatunnel-sql.sh b/bin/start-seatunnel-sql.sh
index 7d1dd58..915016a 100755
--- a/bin/start-seatunnel-sql.sh
+++ b/bin/start-seatunnel-sql.sh
@@ -32,16 +32,25 @@ if [[ "$@" = *--help ]] || [[ "$@" = *-h ]] || [[ $# -le 1 ]]; then
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
diff --git a/seatunnel-core/seatunnel-core-flink/src/main/bin/start-seatunnel-flink.sh b/seatunnel-core/seatunnel-core-flink/src/main/bin/start-seatunnel-flink.sh
index 7af0d8a..f5a3d65 100755
--- a/seatunnel-core/seatunnel-core-flink/src/main/bin/start-seatunnel-flink.sh
+++ b/seatunnel-core/seatunnel-core-flink/src/main/bin/start-seatunnel-flink.sh
@@ -32,16 +32,25 @@ if [[ "$@" = *--help ]] || [[ "$@" = *-h ]] || [[ $# -le 1 ]]; then
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
diff --git a/seatunnel-core/seatunnel-core-spark/src/main/bin/start-seatunnel-spark.sh b/seatunnel-core/seatunnel-core-spark/src/main/bin/start-seatunnel-spark.sh
index 67cb62f..d5ee1f5 100755
--- a/seatunnel-core/seatunnel-core-spark/src/main/bin/start-seatunnel-spark.sh
+++ b/seatunnel-core/seatunnel-core-spark/src/main/bin/start-seatunnel-spark.sh
@@ -16,9 +16,6 @@
# limitations under the License.
#
-
-# copy command line arguments
-
function usage() {
echo "Usage: start-seatunnel-spark.sh [options]"
echo " options:"
@@ -37,26 +34,37 @@ fi
CMD_ARGUMENTS=$@
+is_exist() {
+ if [ -z $1 ]; then
+ usage
+ exit -1
+ fi
+}
+
PARAMS=""
while (( "$#" )); do
case "$1" in
-m|--master)
MASTER=$2
+ is_exist ${MASTER}
shift 2
;;
-e|--deploy-mode)
DEPLOY_MODE=$2
+ is_exist ${DEPLOY_MODE}
shift 2
;;
-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