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

fix #182 fileSync takes empty string postfix option #183

Merged
merged 1 commit into from
Jan 10, 2019

Conversation

gutte
Copy link

@gutte gutte commented Jan 10, 2019

{postfix :""} gives filename without file extension.

@silkentrance
Copy link
Collaborator

@gutte nice find. the same is true for the async file method. perhaps you want to fix it there, too?

@silkentrance
Copy link
Collaborator

@gutte some tests against this issue would be nice, too.

@silkentrance
Copy link
Collaborator

Looking at _generateTmpName(opts), this seems to be the original and desired behaviour, if the user decides to pass in an empty postfix, then the file shall have no '.tmp' extension, see at the very end of the _generateTmpName(opts) function, where the name is assembled from an array.

@silkentrance
Copy link
Collaborator

Okay, here was inverse logic in place. The issue correctly describes the wrong behaviour.

@silkentrance silkentrance merged commit 77d8e7e into raszi:master Jan 10, 2019
@raszi
Copy link
Owner

raszi commented Jan 10, 2019

Good find, but we'll need to add tests for this.

@gutte
Copy link
Author

gutte commented Jan 11, 2019

Hey, yes sorry for the short pull request description. The issue description is clearer.

The behavior for fallback to the default postfix (.tmp) should now be the same for sync and async functions.

@silkentrance
Copy link
Collaborator

silkentrance commented Jan 12, 2019

I am currently doing the tests for this, both for async/sync file and also for async/sync tmpName.

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

Successfully merging this pull request may close these issues.

3 participants