You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@dolphinscheduler.apache.org by GitBox <gi...@apache.org> on 2022/05/25 08:39:38 UTC

[GitHub] [dolphinscheduler] SbloodyS commented on a diff in pull request #10241: [fix] File overwrite when specific value set to installPath

SbloodyS commented on code in PR #10241:
URL: https://github.com/apache/dolphinscheduler/pull/10241#discussion_r881382739


##########
script/install.sh:
##########
@@ -27,6 +27,12 @@ echo "1.create directory"
 if [ ! -d $installPath ];then
   sudo mkdir -p $installPath
   sudo chown -R $deployUser:$deployUser $installPath
+# If install Path equal to "/" or related path is "/" or is empty, will cause directory "/bin" be overwrite or file adding,
+# so we should check its value. Here use command `realpath` to get the related path, and it will skip if your shell env
+# without command `realpath`.
+elif [[ -z "${installPath// }" || "${installPath// }" == "/" || ( $(command -v realpath) && $(realpath -s "${installPath}") == "/" ) ]]; then

Review Comment:
   Is it better moving this logic before 27 line?



-- 
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: commits-unsubscribe@dolphinscheduler.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org