Skip to content

Commit

Permalink
feat(debug): added debug mode
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Feb 19, 2016
1 parent b0016dc commit 615fa60
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -74,6 +74,13 @@ If there are multiple scripts, they will be printed to the console and an error
* Most commands require typing only 3 characters - 2 for the tool itself "nr" and 1 character for the
the script label

## Debug

If something is not working as expected, you can see the verbose debug messages
by running

DEBUG=quick nr ...

### Small print

Author: Gleb Bahmutov © 2015
Expand Down
2 changes: 2 additions & 0 deletions bin/npm-quick-run.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

'use strict'

var debug = require('debug')('quick')
var quickRun = require('..')

var help = [
Expand All @@ -21,5 +22,6 @@ require('simple-bin-help')({
}
})

debug('arguments %d', process.argv.length, process.argv)
var prefix = process.argv[2]
quickRun(prefix)
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@
},
"homepage": "https://github.com/bahmutov/npm-quick-run#readme",
"dependencies": {
"debug": "2.2.0",
"findup": "0.1.5",
"json-package": "1.1.2",
"npm-utils": "1.5.0",
Expand Down
2 changes: 2 additions & 0 deletions src/quick-run.js
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
const debug = require('debug')('quick')
const findScripts = require('json-package').find
const runNpmCommand = require('npm-utils').test
const join = require('path').join
Expand Down Expand Up @@ -80,6 +81,7 @@ function runPrefix (prefix) {
if (extraArguments.length) {
cmd += ' -- ' + extraArguments.join(' ')
}
debug('formed command "%s"', cmd)

runNpmCommand(cmd, npmErrorLoggers)
.catch(function (result) {
Expand Down

0 comments on commit 615fa60

Please sign in to comment.