[redwood] Fix file permissions and add support for build script (#4999)

Some files require execution privileges, such as Prisma, so we must preserve the file mode.

We also want redwood to behave the same as other frameworks and use `yarn build` if available.
This commit is contained in:
Steven
2020-08-10 17:20:13 -04:00
committed by GitHub
parent 2f0ea24552
commit edb31fb412
6 changed files with 68 additions and 16 deletions

View File

@@ -6,7 +6,7 @@ const glob = require('util').promisify(require('glob'));
const path = require('path');
const { spawn } = require('child_process');
const fetch = require('./fetch-retry.js');
const { nowDeploy } = require('./now-deploy.js');
const { nowDeploy, fileModeSymbol } = require('./now-deploy.js');
async function packAndDeploy(builderPath) {
await spawnAsync('npm', ['--loglevel', 'warn', 'pack'], {
@@ -37,6 +37,7 @@ async function testDeployment(
const bodies = globResult.reduce((b, f) => {
const r = path.relative(fixturePath, f);
b[r] = fs.readFileSync(f);
b[r][fileModeSymbol] = fs.statSync(f).mode;
return b;
}, {});