Skip to content
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

Rename CIRCLECI variables, with backwards compatibity #20

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hsanjuan
Copy link
Contributor

In case the script is used outside of CircleCI.

In case the script is used outside of CircleCI.
@hsanjuan hsanjuan requested a review from olizilla June 14, 2022 09:38
Copy link
Member

@olizilla olizilla left a comment

Choose a reason for hiding this comment

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

👍

Comment on lines +24 to +26
: "${SHA1:=$CIRCLE_SHA1}"
: "${PROJECT_USERNAME:=$CIRCLE_PROJECT_USERNAME}"
: "${PROJECT_REPONAME:=$CIRCLE_PROJECT_REPONAME}"
Copy link
Member

Choose a reason for hiding this comment

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

pls enlightne me. What does the preeceeding colon do here?

Choose a reason for hiding this comment

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

image

Source ( grep for The following table )

Copy link
Member

Choose a reason for hiding this comment

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

"these are not the colons you are (i am) looking for"

I meant the initial colon at the start of the line. I find this https://stackoverflow.com/a/4892546

A useful application for : is if you're only interested in using parameter expansions for their side-effects rather than actually passing their result to a command.

In that case, you use the parameter expansion as an argument to either : or false depending upon whether you want an exit status of 0 or 1. An example might be

: "${var:=$1}"

Choose a reason for hiding this comment

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

Ah sorry I misunderstood - yes, this is correct. If you don't add the : it will try to "run" the result.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Man, I copypasted from SO

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@olizilla
Copy link
Member

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