Skip to content

Commit

Permalink
Merge branch 'master' into update-typescript
Browse files Browse the repository at this point in the history
  • Loading branch information
cwhitten authored Dec 3, 2019
2 parents ecdaf57 + cc6ed01 commit 83ba917
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions Composer/scripts/update.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,21 @@ const chalk = require('react-dev-utils/chalk');
const { execSync } = require('child_process');

const RELEASE_BRANCH = 'stable';
const branch = execSync("git branch 2> /dev/null | sed -e '/^[^*]/d' -e 's/* (.*)/ \1/'");
const trimmedBranch = branch
.toString()
.trim()
.replace(/\*\s?/, '');
let currentBranch;

if (trimmedBranch === RELEASE_BRANCH) {
try {
currentBranch = execSync('git branch', { stdio: ['ignore', 'pipe', 'ignore'] })
.toString()
.split('\n')
.find(b => b.startsWith('* '))
.substring(2);
} catch (err) {
// just exit script without error and continue
console.log(chalk.yellow('Unable to compare applications versions.. continuing'));
process.exit();
}

if (currentBranch === RELEASE_BRANCH) {
console.log(chalk.yellow('Checking for updates...\n'));
try {
execSync('git fetch');
Expand Down

0 comments on commit 83ba917

Please sign in to comment.