mirror of
https://github.com/zebrajr/react.git
synced 2025-12-07 00:20:28 +01:00
* Additional release script options for publishing canary versions - `branch` specifies a branch other than master - `local` skips pulling from the remote branch and checking CircleCI - `tag` specifies an npm dist tag other than `latest` or `next` We may add a higher-level `canary` option in the future. * Address Brian's feedback: - Updated description of `local` option - Throws if the `latest` tag is specified for a prerelease version
27 lines
571 B
JavaScript
27 lines
571 B
JavaScript
#!/usr/bin/env node
|
|
|
|
'use strict';
|
|
|
|
const chalk = require('chalk');
|
|
const {exec} = require('child-process-promise');
|
|
const {logPromise} = require('../utils');
|
|
|
|
const update = async ({cwd, branch, local}) => {
|
|
if (!local) {
|
|
await exec('git fetch', {cwd});
|
|
}
|
|
await exec(`git checkout ${branch}`, {cwd});
|
|
if (!local) {
|
|
await exec('git pull', {cwd});
|
|
}
|
|
};
|
|
|
|
module.exports = async params => {
|
|
return logPromise(
|
|
update(params),
|
|
`Updating checkout ${chalk.yellow.bold(
|
|
params.cwd
|
|
)} on branch ${chalk.yellow.bold(params.branch)}}`
|
|
);
|
|
};
|