Skip to content
This repository was archived by the owner on Feb 7, 2026. It is now read-only.

Cleanup prebuild script#142

Merged
mafintosh merged 2 commits intoprebuild:masterfrom
lgeiger:cleanup
Dec 6, 2016
Merged

Cleanup prebuild script#142
mafintosh merged 2 commits intoprebuild:masterfrom
lgeiger:cleanup

Conversation

@lgeiger
Copy link
Copy Markdown
Member

@lgeiger lgeiger commented Dec 6, 2016

Main changes:

  • Replace fs.stat with fs.existsSync
  • Use noop-log in tests

Comment thread prebuild.js Outdated
})
}
]
if (fs.existsSync(tarPath) && !opts.force) {
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

whats the benefit to using existsSync over stat here? function is async anyway

Copy link
Copy Markdown
Member Author

@lgeiger lgeiger Dec 6, 2016

Choose a reason for hiding this comment

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

Personally I think it only makes the code more readable.

But there are also discussions about why existsSync may be better/faster
EDIT: This is actually not the case, here's the link: nodejs/node#8364

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

I don't think we should start using sync calls in async methods. It's a bad pattern.

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

👍 Removed the last commit.

@mafintosh
Copy link
Copy Markdown
Collaborator

+1 except for the sync call

@mafintosh mafintosh merged commit 4cc9c9d into prebuild:master Dec 6, 2016
@mafintosh
Copy link
Copy Markdown
Collaborator

👍 Thanks! Do you wanna help maintain this in general?

@mafintosh
Copy link
Copy Markdown
Collaborator

5.0.1

@lgeiger lgeiger deleted the cleanup branch December 6, 2016 10:05
@lgeiger
Copy link
Copy Markdown
Member Author

lgeiger commented Dec 6, 2016

Do you wanna help maintain this in general?

Sure, I'm happy to help 🎉

Comment thread prebuild.js
buildLog('Prebuild written to ' + tarPath)
callback(null, tarPath)
})
async.waterfall(tasks, callback)
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Nice!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants