Comparing version 2.10.1 to 2.11.0
11
cli.js
#!/usr/bin/env node | ||
'use strict'; | ||
const logSymbols = require('log-symbols'); | ||
const meow = require('meow'); | ||
@@ -17,6 +18,6 @@ const updateNotifier = require('update-notifier'); | ||
Options | ||
--any-branch Allow publishing from any branch | ||
--skip-cleanup Skips cleanup of node_modules | ||
--yolo Skips cleanup and testing | ||
--tag Publish under a given dist-tag | ||
--any-branch Allow publishing from any branch | ||
--no-cleanup Skips cleanup of node_modules | ||
--yolo Skips cleanup and testing | ||
--tag Publish under a given dist-tag | ||
@@ -56,4 +57,4 @@ Examples | ||
.catch(err => { | ||
console.error(`\n${err.message}`); | ||
console.error(`\n${logSymbols.error} ${err.message}`); | ||
process.exit(1); | ||
}); |
15
index.js
@@ -12,2 +12,3 @@ 'use strict'; | ||
const gitTasks = require('./lib/git'); | ||
const util = require('./lib/util'); | ||
@@ -26,7 +27,15 @@ const exec = (cmd, args) => { | ||
input = input || 'patch'; | ||
opts = opts || {}; | ||
opts = Object.assign({ | ||
cleanup: true | ||
}, opts); | ||
// TODO: remove sometime far in the future | ||
if (opts.skipCleanup) { | ||
opts.cleanup = false; | ||
} | ||
const runTests = !opts.yolo; | ||
const runCleanup = !opts.skipCleanup && !opts.yolo; | ||
const pkg = readPkgUp.sync().pkg; | ||
const runCleanup = opts.cleanup && !opts.yolo; | ||
const pkg = util.readPkg(); | ||
@@ -33,0 +42,0 @@ const tasks = new Listr([ |
'use strict'; | ||
const execa = require('execa'); | ||
const inquirer = require('inquirer'); | ||
const readPkgUp = require('read-pkg-up'); | ||
const chalk = require('chalk'); | ||
const util = require('./util'); | ||
const version = require('./version'); | ||
module.exports = options => { | ||
const pkg = readPkgUp.sync().pkg; | ||
const pkg = util.readPkg(); | ||
const oldVersion = pkg.version; | ||
@@ -11,0 +11,0 @@ |
{ | ||
"name": "np", | ||
"version": "2.10.1", | ||
"version": "2.11.0", | ||
"description": "A better `npm publish`", | ||
@@ -49,2 +49,3 @@ "license": "MIT", | ||
"listr": "^0.6.1", | ||
"log-symbols": "^1.0.2", | ||
"meow": "^3.7.0", | ||
@@ -51,0 +52,0 @@ "read-pkg-up": "^1.0.1", |
@@ -10,3 +10,3 @@ # np [](https://travis-ci.org/sindresorhus/np) | ||
- [Interative UI](#interactive-ui) | ||
- [Interactive UI](#interactive-ui) | ||
- Ensures you are publishing from the `master` branch | ||
@@ -41,6 +41,6 @@ - Ensures the working directory is clean and that there are no unpulled changes | ||
Options | ||
--any-branch Allow publishing from any branch | ||
--skip-cleanup Skips cleanup of node_modules | ||
--yolo Skips cleanup and testing | ||
--tag Publish under a given dist-tag | ||
--any-branch Allow publishing from any branch | ||
--no-cleanup Skips cleanup of node_modules | ||
--yolo Skips cleanup and testing | ||
--tag Publish under a given dist-tag | ||
@@ -47,0 +47,0 @@ Examples |
16892
10
359
14
+ Addedlog-symbols@^1.0.2