Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add confirmation prompts to unsafe cli commands (#6878)
* feat: added logic handeling for the `env:set` command Will prompt the user if scope and/or context is not provided Co-authored-by: Thomas Lane <[email protected]> * feat: prompt before setting env variable across context and scope Co-authored-by: Will <[email protected]> * fix: prettier Co-authored-by: Will <[email protected]> * fix: refactored prompts Co-authored-by: Will <[email protected]> * fix: refactor prompts Co-authored-by: Will <[email protected]> * feat: env:unset prompts user before unsetting env variable indiscriminantly across contexts Co-authored-by: Will <[email protected]> * feat: created tests for env:set prompts Created several tests to check env:test prompts * build: refactored env:set promts and rewrote tests created a new directory in utils called prompts, to store all future prompts. rewrote the prompts to only check for destructive actions. added tests for each of the destructive prompts Co-authored-by: Thomas Lane <[email protected]> * feat: added prompt for env:clone and tests Co-authored-by: Thomas Lane <[email protected]> * fix: prettier fix Co-authored-by: Thomas Lane <[email protected]> * build: added prompts and tests for blob command for blobl:set and blob:delete Co-authored-by: Thomas Lane <[email protected]> * fix: updated tests in file to reflect new prompts * fix: updated documentation updated the documentation Co-authored-by: Thomas Lane <[email protected]> * fix: updated error updated error handeling Co-authored-by: Thomas Lane <[email protected]> Co-authored-by: Thomas Lane <[email protected]> * fix: updated new lines in messages for consistence updated prompts spacing for consistencey Co-authored-by: Thomas Lane <[email protected]> * fix: fixed prettier error Co-authored-by: Thomas Lane <[email protected]> * feat: env-set refactored refactored messages in env-set to a function that exports an object to be reused Co-authored-by: Thomas Lane <[email protected]> * fix: reactored env:unset prompts Co-authored-by: Thomas Lane <[email protected]> * fix: refactored prompts and tests messages Co-authored-by: Thomas Lane <[email protected]> Co-authored-by: Thomas Lane <[email protected]> * fix: another pass of refactoring env and blob commands Co-authored-by: Thomas Lane <[email protected]> Co-authored-by: Thomas Lane <[email protected]> * feat: added skip for non interactive shell and CI Co-authored-by: Thomas Lane <[email protected]> Co-authored-by: Thomas Lane <[email protected]> * feat: refactored code for tests realted to ci and prompts Co-authored-by: Thomas Lane <[email protected]> Co-authored-by: Thomas Lane <[email protected]> * fix: prettier fix Co-authored-by: Thomas Lane <[email protected]> * fix: removed console.log statements Co-authored-by: Thomas Lane <[email protected]> * fix: updated prompts based on pr feedback Co-authored-by: Thomas Lane <[email protected]> * feat: added force flag option to all commands scripted commands automatically given the force flag Co-authored-by: Will <[email protected]> * fix: started updating tests to work with higher level --force flag for scritped commands Co-authored-by: Will <[email protected]> * feat: refactored tests to use mockProgram Co-authored-by: Thomas Lane <[email protected]> * feat: refactor of run.js into components to add force flag Co-authored-by: Thomas Lane <[email protected]> * fix: types.ts merge } deletion Co-authored-by: Thomas Lane <[email protected]> * fix: fix default lint issue and typescript issue fixed lint issue that was casuing test in ci enviroment to fail Co-authored-by: Thomas Lane <[email protected]> * fix: update blob to blobs Co-authored-by: Thomas Lane <[email protected]> * fix: updated prompt tests for ci/cd enviroment Co-authored-by: Thomas Lane <[email protected]> * fix: updated prompt tests to work correctly in ci/cd enviroments Co-authored-by: Thomas Lane <[email protected]> * fix: updated types and env variables not being restored after tests Co-authored-by: Thomas Lane <[email protected]> * fix: fixed tests Co-authored-by: Thomas Lane <[email protected]> * fix: fixed flakey deploy test and added env cleanup to more tests * fix: removed a console.log() statement Co-authored-by: Thomas Lane <[email protected]> * fix: cleaned up unused functions and comments Co-authored-by: Thomas Lane <[email protected]> * chore: cleanup comments minor bug fixes Co-authored-by: Will <[email protected]> * chore: prettier, needed to update docs Co-authored-by: Will <[email protected]> * chore: merged updates to main.ts Co-authored-by: Will <[email protected]> * fix: reset env variable and mocks type error * fix: fixed test type error part 2 * fix: removed restModules from test * fix: updated test to have inquirer mocked correctly add the missing methods to the inquirer mock to fix all type errors * fix: reverted the force flags on lm commands to original behavior as the force option was for credential helper installation rather than skipping prompts Co-authored-by: Will <[email protected]> --------- Co-authored-by: Thomas Lane <[email protected]> Co-authored-by: t <[email protected]> Co-authored-by: Thomas Lane <[email protected]> Co-authored-by: Daniel Lew <[email protected]>
- Loading branch information