Skip to content

Conversation

@t-gitt
Copy link
Contributor

@t-gitt t-gitt commented Nov 1, 2021

No description provided.


cd $DEPLOY_DIR/current && docker-compose -f docker-compose.yml up -d --no-build

if [ ! -z "$LOG_DIR" ]; then
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Is -z usable in a POSIX (non-bash) shell? I haven't seen it outside of bash before so need confirmation.

Also this is checking if value for $LOG_DIR is set, do we also need a check for the directory existing (which should also be a valid check in case the path is a symlink to another directory)?

Copy link
Contributor Author

@t-gitt t-gitt Nov 2, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,
-z seems usable in POSIX shell. As it takes -z as an operand for test command and I understood we can use if test <expression> and if [ <expression> ] interchangeably.

but since I am using ! -z i saw it's recommended to use -n operand instead, so I've changed it to that.

I also added another check for $LOG_DIR so that it will only try to create the folder if $LOG_DIR folder doesn't exist.

@t-gitt t-gitt force-pushed the ta_save_log_docker_pull branch 2 times, most recently from 74ac8c2 to d0f066f Compare November 2, 2021 01:35
@t-gitt t-gitt force-pushed the ta_save_log_docker_pull branch from d0f066f to 7d8c5d3 Compare November 8, 2021 05:10
@ritesh-loanstreet ritesh-loanstreet merged commit a6d392f into master Nov 8, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

3 participants