Skip to content

Commit

Permalink
fix(gatsby-dev-cli): chmod gatsby bin on copy (#19985)
Browse files Browse the repository at this point in the history
  • Loading branch information
blainekasten authored and GatsbyJS Bot committed Dec 6, 2019
1 parent f4760a8 commit a4d1126
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions packages/gatsby-dev-cli/src/watch.js
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,15 @@ async function watch(
}
}

// When the gatsby binary is copied over, it is not setup with the executable
// permissions that it is given when installed via yarn.
// This fixes the issue where after running gatsby-dev, running `yarn gatsby develop`
// fails with a permission issue.
// @fixes https://github.com/gatsbyjs/gatsby/issues/18809
if (/bin\/gatsby.js$/.test(newPath)) {
fs.chmodSync(newPath, `0755`)
}

numCopied += 1
if (!quiet) {
console.log(`Copied ${oldPath} to ${newPath}`)
Expand Down Expand Up @@ -147,6 +156,7 @@ async function watch(
/\.git/i,
/\.DS_Store/,
/[/\\]__tests__[/\\]/i,
/[/\\]__mocks__[/\\]/i,
/\.npmrc/i,
].concat(
allPackagesToWatch.map(p => new RegExp(`${p}[\\/\\\\]src[\\/\\\\]`, `i`))
Expand Down

0 comments on commit a4d1126

Please sign in to comment.