Skip to content

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

@Oceanity Oceanity requested a review from ebiggz as a code owner September 11, 2024 20:11
@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
@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