You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@airflow.apache.org by GitBox <gi...@apache.org> on 2021/10/20 12:02:57 UTC
[GitHub] [airflow] potiuk commented on a change in pull request #19100: pyenv related docs added, warning message in breeze initialize-local-virtualenv command
potiuk commented on a change in pull request #19100:
URL: https://github.com/apache/airflow/pull/19100#discussion_r732699219
##########
File path: breeze
##########
@@ -283,6 +283,13 @@ function breeze::initialize_virtualenv() {
echo
echo "Wiping and recreating ${AIRFLOW_HOME_DIR}"
echo
+ SCRIPTPATH="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )"
+ if [ "${SCRIPTPATH}" = "${AIRFLOW_HOME_DIR}" ]; then
Review comment:
We prefer [[ ]] over [] - generally we try to follow Google she guide - you can read more on why [[]] is better https://google.github.io/styleguide/shellguide.html#test----and---
##########
File path: breeze
##########
@@ -283,6 +283,13 @@ function breeze::initialize_virtualenv() {
echo
echo "Wiping and recreating ${AIRFLOW_HOME_DIR}"
echo
+ SCRIPTPATH="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )"
+ if [ "${SCRIPTPATH}" = "${AIRFLOW_HOME_DIR}" ]; then
+ echo "AIRFLOW_HOME and Source code for Apache Airflow resides in the same path ${AIRFLOW_HOME_DIR}"
+ echo "When running this command it will delete all the files in the path ${AIRFLOW_HOME_DIR} to clear dynamic files like config/logs/db"
+ echo "Move your source code for Apache Airflow to different folder to avoid deletion"
+ exit 0
Review comment:
Exit should be with error code (exit 1 is fine)
##########
File path: breeze
##########
@@ -283,6 +283,13 @@ function breeze::initialize_virtualenv() {
echo
echo "Wiping and recreating ${AIRFLOW_HOME_DIR}"
echo
+ SCRIPTPATH="$( cd -- "$(dirname "${BASH_SOURCE[0]}")" >/dev/null 2>&1 ; pwd -P )"
Review comment:
We already have AIRFLOW_SOURCES that we can use here (see beginning of the breeze script).
--
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@airflow.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org