react/scripts/release/create-next-commands/build-artifacts.js
Brian Vaughn 9e158c091b
Updated release script documentation and command names (#17929)
* Updated release script documentation and command names

* Update scripts/release/README.md

Co-Authored-By: Sunil Pai <threepointone@oculus.com>

* Updated README

Co-authored-by: Sunil Pai <threepointone@oculus.com>
2020-02-05 08:52:31 -08:00

26 lines
661 B
JavaScript

#!/usr/bin/env node
'use strict';
const {exec} = require('child-process-promise');
const {join} = require('path');
const {logPromise} = require('../utils');
const run = async ({cwd, dry, tempDirectory}) => {
const defaultOptions = {
cwd: tempDirectory,
};
await exec('yarn install', defaultOptions);
await exec('yarn build -- --extract-errors', defaultOptions);
const tempNodeModulesPath = join(tempDirectory, 'build', 'node_modules');
const buildPath = join(cwd, 'build');
await exec(`cp -r ${tempNodeModulesPath} ${buildPath}`);
};
module.exports = async params => {
return logPromise(run(params), 'Building artifacts', 600000);
};