forked from sindresorhus/np
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcli.js
More file actions
executable file
·31 lines (26 loc) · 709 Bytes
/
Copy pathcli.js
File metadata and controls
executable file
·31 lines (26 loc) · 709 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/usr/bin/env node
'use strict';
const meow = require('meow');
const updateNotifier = require('update-notifier');
const np = require('./');
const cli = meow(`
Usage
$ np [major | minor | patch | premajor | preminor | prepatch | prerelease | <version>] (Default: patch)
Options
--any-branch Allow publishing from any branch
--skip-cleanup Skips cleanup of node_modules
--yolo Skips cleanup and testing
Examples
$ np
$ np patch
$ np 1.0.2
`);
updateNotifier({pkg: cli.pkg}).notify();
np(cli.input[0], cli.flags)
.then(pkg => {
console.log(`\n ${pkg.name} ${pkg.version} published`);
})
.catch(err => {
console.error(`\n${err.message}`);
process.exit(1);
});