Skip to content

Commit

Permalink
fix: postinstall with node@4 (#634)
Browse files Browse the repository at this point in the history
  • Loading branch information
brunopedroso authored and gr2m committed Nov 2, 2016
1 parent d7009d7 commit 8cc6897
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions bin/setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ if (saveRequested) {

// Create README.md if one is not found.
// - https://nodejs.org/api/fs.html#fs_fs_access_path_mode_callback
fs.open(path.join(pathToAppRoot, 'README.md'), 'wx',
var readmePath = path.join(pathToAppRoot, 'README.md')
fs.open(readmePath, 'wx',
function (error, fd) {
if (error) {
if (error.code === 'EEXIST') {
Expand All @@ -47,7 +48,7 @@ if (saveRequested) {
// - https://nodejs.org/api/path.html#path_path_parse_path
var base = path.parse(pathToAppRoot).base
var readMeContents = '# ' + base + '\n' + 'Created with [hoodie](https://github.com/hoodiehq)'
fs.writeFile(fd, readMeContents,
fs.writeFile(readmePath, readMeContents,
function (error) {
if (error) {
log.error('setup', 'Could not create README.md at ' + pathToAppRoot)
Expand Down

0 comments on commit 8cc6897

Please sign in to comment.