usebruno / bruno

Opensource IDE For Exploring and Testing Api's (lightweight alternative to postman/insomnia)
https://www.usebruno.com/
MIT License
25.67k stars 1.17k forks source link

feat(bru-rmvar): add bru.rmVar(varType, key) command #2472

Closed bpoulaindev closed 3 weeks ago

bpoulaindev commented 3 months ago

Description

Referencing issue #2464

Add a new bru.rmVar() command that helps replicate pm.environment.unset()

The command is recognized in the UI and can edit content from envVariables, collectionVariables and also processEnvVars. How to use : bru.rmVar([varType], [key])

image image

Contribution Checklist:

Note: Keeping the PR small and focused helps make it easier to review and merge. If you have multiple changes you want to make, please consider submitting them as separate pull requests.

Publishing to New Package Managers

Please see here for more information.

bpoulaindev commented 3 months ago

The commands #1714 are also interesting, and considering those are simple and necessary, while the PR is more than 3 months old is crazy

martinsefcik commented 3 months ago

If there are setVar/getVar and setEnvVar/getEnvVar methods why not to have rmVar and rmEnvVar?
In my eyes it is better as to introduce some weird and long varType strings which will be error prone because of typos during typing it.

helloanoop commented 3 weeks ago

Thank for taking time to work on this @bpoulaindev

Bruno now supports bru.deleteVar() which was implemented as a part of another PR Closing this PR.