Skip to content
Snippets Groups Projects
Unverified Commit ca8bdae5 authored by Nemanja Glumac's avatar Nemanja Glumac Committed by GitHub
Browse files

Update fallback for `interactive?` check (#31311)

We migrated from CircleCI a long time ago and are now using GitHub Actions.
But even without that CircleCI, like many other CI providers, sets the
`CI` environment variable to `true` or to `1` by default.

This PR updates the `interactive?` check to use that env var as fallback.
parent a05e552b
No related branches found
No related tags found
No related merge requests found
......@@ -6,12 +6,13 @@
(defn interactive?
"Whether we're running these scripts interactively, and can prompt the user for input. By default, this is
true (except when running in CircleCI), but if the env var `INTERACTIVE=false` is set, these scripts will not prompt
for input. Be sure to set this when running scripts in CI or other places that automate them."
true (except when running in CI), but if the env var `INTERACTIVE=false` is set, these scripts will not prompt
for input. Be sure to set this when running scripts in CI or other places that automate them. Most CI providers
set the `CI` env var to true by default, so we can use that as a fallback."
[]
(if-let [env-var (env/env :interactive)]
(Boolean/parseBoolean env-var)
(not (:circleci env/env))))
(not (:ci env/env))))
(defn read-line-with-prompt
"Prompt for and read a value from stdin. Accepts two options: `:default`, which is the default value to use if the
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment