Skip to content
Discussion options

You must be logged in to vote

I looked into this and it seems that there is no way to get the name easily but you can kind of get around it by reading every file in the current working directory and look for the name there.

To do this you will need to turn on the node library fs by going to your the bruno.json file in your collection folder and adding this element:

"scripts": {
  "filesystemAccess": {
    "allow": true
  }
 }

Then in your collection folder add this snippet to the post-script:

const fs = require("fs");
const path = require("path");
const dir = path.join(bru.cwd());
const getAllFiles = function(dirPath, arrayOfFiles) {
  files = fs.readdirSync(dirPath);
  arrayOfFiles = arrayOfFiles || [];
  files.forEach(

Replies: 2 comments 2 replies

Comment options

You must be logged in to vote
1 reply
@CoenraadS
Comment options

Answer selected by CoenraadS
Comment options

You must be logged in to vote
1 reply
@Cliffart44
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants