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

Normalize Filename #2996

Open
helloanoop opened this issue Sep 2, 2024 · 1 comment
Open

Normalize Filename #2996

helloanoop opened this issue Sep 2, 2024 · 1 comment
Labels
enhancement New feature or request

Comments

@helloanoop
Copy link
Contributor

helloanoop commented Sep 2, 2024

Bruno saves requests as files, where the file name is derived from the request name. This can create issues because certain characters are not allowed in file names due to OS constraints.

Currently, we use the following code to normalize file names:

export const normalizeFileName = (name) => {
  if (!name) {
    return name;
  }

  const validChars = /[^\w\s-]/g;
  const formattedName = name.replace(validChars, '-');

  return formattedName;
};

However, this approach has limitations.

To improve this, Bruno supports a name property within each .bru file. This allows us to use any characters for the request name while only needing to normalize the file name part.

We have some UX ideas on how to enable this, which we share soon. Please standby for more updates.

Related Issues

Related PRs

@helloanoop helloanoop added the enhancement New feature or request label Sep 2, 2024
@helloanoop
Copy link
Contributor Author

This is being worked upon. PR for reference: #3094

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

No branches or pull requests

1 participant