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

Feat: fileName replace variable #2803

Merged
merged 5 commits into from
Sep 23, 2024

Conversation

Oceanity
Copy link
Contributor

Description of the Change

Adds a replace variable that takes any file path, relative or absolute, and returns the name of the file with no extension.

Applicable Issues

N/A

Testing

Tested many edge cases and got successful results, should work with anything that basename in the path Node package can parse the name of.

Screenshots

N/A

@CaveMobster
Copy link
Member

Nice addition!

So just to verify: you intend to convert path\to\file.txt to file.txt with this variable. Is that correct? Because I'd say that removes the file path, not the extension of the file, which makes the description a bit confusing.

@Oceanity
Copy link
Contributor Author

Nice addition!

So just to verify: you intend to convert path\to\file.txt to file.txt with this variable. Is that correct? Because I'd say that removes the file path, not the extension of the file, which makes the description a bit confusing.

So, the idea is to make it path\to\file.txt to file, but someone pointed out it could be simplified with the path package instead of the manual regex method I had set up, and I didn't bother actually making sure it was fine afterwards 😅

Thanks for catching that, will push a fix

@Oceanity
Copy link
Contributor Author

Fixed in c629587

image

image

Copy link
Member

@CaveMobster CaveMobster left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking great, thanks for adding this!

@CaveMobster CaveMobster merged commit d78fe8d into crowbartools:v5 Sep 23, 2024
1 check passed
@Oceanity Oceanity deleted the feature/filename-replace-var branch September 23, 2024 21:14
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

Successfully merging this pull request may close these issues.

2 participants