Skip to content

Commit

Permalink
feat: add force option to skip git status check (#46)
Browse files Browse the repository at this point in the history
  • Loading branch information
vagusX authored Jan 7, 2020
1 parent 02e9fbb commit 0afd482
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions bin/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -148,16 +148,29 @@ async function transform(transformer, parser, globPath, styleOption) {
}

async function bootstrap() {
const dir = process.argv[2];
// eslint-disable-next-line global-require
const args = require('yargs-parser')(process.argv.slice(3));
if (process.env.NODE_ENV !== 'local') {
// check for updates
await checkUpdates();
// check for git status
await ensureGitClean();
if (!args.force) {
await ensureGitClean();
} else {
console.log(
Array(3)
.fill(1)
.map(() =>
chalk.yellow(
'WARNING: You are trying to skip git status checking, please be careful',
),
)
.join('\n'),
);
}
}

const dir = process.argv[2];
const args = require('yargs-parser')(process.argv.slice(3));

// check for `path`
if (!dir || !fs.existsSync(dir)) {
console.log(chalk.yellow('Invalid dir:', dir, ', please pass a valid dir'));
Expand Down

0 comments on commit 0afd482

Please sign in to comment.