@samitouri / QOS-React / commits / 77ebeb1b09

Don't git commit noop-renderer unless package deps change (#12623)

Brian Vaughn committed Apr 16, 2018 at 09:46 UTC 77ebeb1b09221d031c776f18b5134bd33d600c07
1 file changed +8 -5
scripts/release/build-commands/update-noop-renderer-dependencies.js
+8 -5
@@ -5,7 +5,7 @@
5 const {readJson, writeJson} = require('fs-extra');
6 const {join} = require('path');
7 const semver = require('semver');
8 -const {execUnlessDry, logPromise} = require('../utils');
8 +const {execRead, execUnlessDry, logPromise} = require('../utils');
9
10 const getReactReconcilerVersion = async cwd => {
11 const path = join(cwd, 'packages', 'react-reconciler', 'package.json');
@@ -33,10 +33,13 @@ const update = async ({cwd, dry}) => {
33
34 await writeJson(path, json, {spaces: 2});
35
36 - await execUnlessDry(
37 - `git commit -am "Updating dependencies for react-noop-renderer"`,
38 - {cwd, dry}
39 - );
36 + const status = await execRead('git status -s', {cwd});
37 + if (status) {
38 + await execUnlessDry(
39 + `git commit -am "Updating dependencies for react-noop-renderer"`,
40 + {cwd, dry}
41 + );
42 + }
43 };
44
45 module.exports = async params => {