[Bug]: SHOPIFY_CLI_TTY behavior inverted when CLI crashes (same issue as #3391)
Please confirm that you have:
- [X] Searched existing issues to see if your issue is a duplicate. (If you’ve found a duplicate issue, feel free to add additional information in a comment on it.)
- [X] Reproduced the issue in the latest CLI version.
In which of these areas are you experiencing a problem?
Theme
Expected behavior
CLI does not prompt for user input. This is the same issue as #3391
Actual behavior
prompts for user input.
Verbose output
shopify theme push --path ./ --theme $DEV_THEME_ID --store $SHOPIFY_STORE
3s
+ shopify theme push --path ./ --theme $DEV_THEME_ID --store $SHOPIFY_STORE
╭─ error ──────────────────────────────────────────────────────────────────────╮
│ │
│ Failed to prompt: │
│ │
│ Push theme files to the published theme on │
│ <store-url>? │
│ │
│ This usually happens when running a command non-interactively, for example │
│ in a CI environment, or when piping input from another process. │
│ │
│ To resolve this, specify the option in the command, or run the command in │
│ an interactive environment such as your local terminal.
Reproduction steps
- create bitbucket account
- create repo for theme in bitbucket
- create this pipeline in repo:
pipelines:
default:
- step:
name: Deploy
image: ruby:3.1
services:
- docker
caches:
- node
script:
- echo "Hello World!"
- apt-get update
- apt-get install -y nodejs npm
- npm install -g @shopify/cli @shopify/theme
- echo $(ls)
- export SHOPIFY_FLAG_STORE=$SHOPIFY_STORE
- export SHOPIFY_CLI_THEME_TOKEN=$SHOPIFY_CLI_THEME_TOKEN
- export SHOPIFY_CLI_TTY=$SHOPIFY_CLI_TTY
- shopify theme push --path ./ --theme $DEV_THEME_ID --store $SHOPIFY_STORE
- set the environment variables as appropriate
- run the pipeline
Operating System
windows 11 (my system), however the build is running using docker
Shopify CLI version (check your project's package.json if you're not sure)
latest
Shell
No response
Node version (run node -v if you're not sure)
No response
What language and version are you using in your application?
No response
hi @seanwbarry ! thanks for reporting this issue, i misspoke in my first comment (now deleted). we're moving away from using SHOPIFY_CLI_TTY for theme commands, instead use --force for CI to skip prompts. let us know if that fixes your issue 🙏
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.
Hi @seanwbarry! Thanks for reporting this issue, can you try again with the latest CLI version and see if the issue still persists? Changes were shipped for https://github.com/Shopify/cli/issues/1573 that resolved a bug where SHOPIFY_CLI_TTY was not being respected. Thanks in advance
This issue seems inactive. If it's still relevant, please add a comment saying so. Otherwise, take no action. → If there's no activity within a week, then a bot will automatically close this. Thanks for helping to improve Shopify's dev tooling and experience.
P.S. You can learn more about why we stale issues here.