Skip to content

Add default path for 'BATS_LIB_PATH' environment variable' #628

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Aug 12, 2022
Merged

Add default path for 'BATS_LIB_PATH' environment variable' #628

merged 3 commits into from
Aug 12, 2022

Conversation

hwittenborn
Copy link
Contributor

@hwittenborn hwittenborn requested a review from a team as a code owner August 8, 2022 23:42
@martin-schulze-vireso martin-schulze-vireso merged commit 690a3a9 into bats-core:master Aug 12, 2022
@martin-schulze-vireso
Copy link
Member

Thanks for your contribution.

@hwittenborn
Copy link
Contributor Author

@martin-schulze-vireso: Any idea when the next release will be made? I'd like to start using this in my tests but I need to deploy it via my Debian package first.

@martin-schulze-vireso
Copy link
Member

Well, the deadline for 1.8.0 is this month. However, I want to close all issues in the milestone.

@@ -101,6 +101,7 @@ export BATS_TMPDIR="${TMPDIR:-/tmp}"
BATS_TMPDIR=${BATS_TMPDIR%/} # chop off trailing / to avoid duplication
export BATS_RUN_TMPDIR=
export BATS_GUARANTEED_MINIMUM_VERSION=0.0.0
export BATS_LIB_PATH=${BATS_LIB_PATH-/usr/lib/bats}
Copy link

Choose a reason for hiding this comment

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

Sorry for the drive-by comment, but shouldn't this be ${BATS_LIB_PATH:-/usr/lib/bats}? (Note the colon.)

Choose a reason for hiding this comment

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

I only translated this from the original Code but I assumed the intention is to allow for users to specify an empty search path. This would mit ve possible with colon.

Copy link

Choose a reason for hiding this comment

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

Sure, but the syntax for that is ${var:-default}, not ${var-default}, right? (Bash docs)

Copy link
Member

@martin-schulze-vireso martin-schulze-vireso Aug 16, 2022

Choose a reason for hiding this comment

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

No, :- is alternative value for unset or empty, - only replaces unset variables. Or from your link:

Omitting the colon results in a test only for a parameter that is unset. Put another way, if the colon is included, the operator tests for both parameter’s existence and that its value is not null; if the colon is omitted, the operator tests only for existence.

Copy link

Choose a reason for hiding this comment

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

I did not know that. Thank you for the explanation!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants