react/scripts/release/publish-commands/check-build-status.js
Clement Hoang 94f44aeba7
Update prettier to 1.8.1 (#10785)
* Change prettier dependency in package.json version 1.8.1

* Update yarn.lock

* Apply prettier changes

* Fix ReactDOMServerIntegration-test.js

* Fix test for ReactDOMComponent-test.js
2017-11-07 18:09:33 +00:00

27 lines
616 B
JavaScript

#!/usr/bin/env node
'use strict';
const chalk = require('chalk');
const {existsSync} = require('fs');
const {readJson} = require('fs-extra');
const {join} = require('path');
module.exports = async ({cwd, version}) => {
const packagePath = join(cwd, 'build', 'packages', 'react', 'package.json');
if (!existsSync(packagePath)) {
throw Error('No build found');
}
const packageJson = await readJson(packagePath);
if (packageJson.version !== version) {
throw Error(
chalk`Expected version {bold.white ${version}} but found {bold.white ${
packageJson.version
}}`
);
}
};