react/scripts/release/publish-commands/check-build-status.js
Dan Abramov 1ebeb0542f
Move npm output from build/packages/* to build/node_modules/* (#11962)
* Move build/packages/* to build/node_modules/*

This fixes Node resolution in that folder and lets us require() packages in it in Node shell for manual testing.

* Link fixtures to packages/node_modules

This updates the location and also uses link: instead of file: to avoid Yarn caching the folder contents.
2018-01-04 19:01:31 +00:00

33 lines
644 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',
'node_modules',
'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
}}`
);
}
};