balena-io / balena-cli

The official balena CLI tool.
Apache License 2.0
455 stars 141 forks source link

balena device rm --yes should not need a TTY #1808

Open jeff-hiner opened 4 years ago

jeff-hiner commented 4 years ago

Given a file with one uuid per line, the following should work:

$ cat easy_delete.txt | xargs -I '{}' -L1 balena device rm  '{}' --debug --yes
Prompts can not be meaningfully rendered in non-TTY environments

Error: Prompts can not be meaningfully rendered in non-TTY environments
    at PromptUI.fetchAnswer (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/inquirer/lib/ui/prompt.js:87:27)
    at MergeMapSubscriber._tryNext (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/operators/mergeMap.js:69:27)
    at MergeMapSubscriber._next (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MergeMapSubscriber.notifyNext (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/operators/mergeMap.js:95:26)
    at InnerSubscriber._next (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/InnerSubscriber.js:28:21)
    at InnerSubscriber.Subscriber.next (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/Subscriber.js:66:18)
    at Observable._subscribe (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/util/subscribeToArray.js:5:20)
    at Observable._trySubscribe (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/Observable.js:44:25)
    at Observable.subscribe (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/Observable.js:30:22)
    at Object.subscribeToResult (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/util/subscribeToResult.js:12:23)
    at MergeMapSubscriber._innerSub (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/operators/mergeMap.js:82:53)
    at MergeMapSubscriber._tryNext (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/operators/mergeMap.js:76:14)
    at MergeMapSubscriber._next (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/operators/mergeMap.js:59:18)
    at MergeMapSubscriber.Subscriber.next (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/Subscriber.js:66:18)
    at MergeMapSubscriber.notifyNext (/home/jhiner/.nvm/versions/node/v12.16.3/lib/node_modules/balena-cli/node_modules/rxjs/internal/operators/mergeMap.js:95:26)


pdcastro commented 4 years ago

Connects-to: #1089 Implement scriptable (non-interactive) mode

srlowe commented 4 years ago

I wasn't able to reproduce this, it could have been fixed in recent change.

pdcastro commented 4 years ago

@srlowe, are you able to reproduce it by checking out CLI release/tag v11.32.15? (Or using a standalone zip file from the releases page.) If it can be reproduced with v11.32.15 but not with the latest release, then you could say it is "proof" that it was fixed. :-)