Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Feature Request] Allow additional script context roots #438

Closed
DaPutzy opened this issue Oct 6, 2023 · 2 comments
Closed

[Feature Request] Allow additional script context roots #438

DaPutzy opened this issue Oct 6, 2023 · 2 comments

Comments

@DaPutzy
Copy link
Contributor

DaPutzy commented Oct 6, 2023

Given our git repository structure:

all requests and environments omitted as well as simplified

.
├── collection-1
│   └── bruno.json
├── collection-2
│   └── bruno.json
├── collection-3
│   └── bruno.json
└── scripts
    ├── foo.js
    └── bar.js

We would like to be able to access the shared scripts foo.js and bar.js in mutliple collections.
Currently the only way to achieve this without duplicating the scripts is by using symlinks:

all requests and environments omitted as well as simplified

.
├── collection-1
│   ├── bruno.json
│   ├── scripts -> ../scripts
├── collection-2
│   ├── bruno.json
│   ├── scripts -> ../scripts
├── collection-3
│   ├── bruno.json
│   ├── scripts -> ../scripts
└── scripts
    ├── foo.js
    └── bar.js

Im not a fan especially because the symlinks are shown as empty folders in the UI.

@DaPutzy
Copy link
Contributor Author

DaPutzy commented Oct 6, 2023

This relates to #178 and #317 with the difference being access to scripts across collections :)

@DaPutzy
Copy link
Contributor Author

DaPutzy commented Oct 25, 2023

I created a PR (#795) to add this feature.

With that change i can add:

  "scripts": {
    "additionalContextRoots": [
      "../scripts"
    ]
  }

to my collection config and then use scripts that are outside the actual collection folder, e.g.:

const foo = require("../scripts/foo.js");
const bar = require("../scripts/bar.js");

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant