Skip to content

Commit

Permalink
feat(log): replace console log calls with debug module, close #2
Browse files Browse the repository at this point in the history
  • Loading branch information
bahmutov committed Dec 4, 2016
1 parent fc904c9 commit 2491019
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 16 deletions.
15 changes: 12 additions & 3 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,15 @@
language: node_js
cache:
directories:
- node_modules
notifications:
email: false
node_js:
- "0.10"
- '6'
before_script:
- npm prune
after_success:
- npm run semantic-release
branches:
only:
- master
except:
- /^v\d+\.\d+\.\d+$/
13 changes: 5 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,7 @@
[![NPM][chdir-promise-icon] ][chdir-promise-url]

[![Build status][chdir-promise-ci-image] ][chdir-promise-ci-url]
[![dependencies][chdir-promise-dependencies-image] ][chdir-promise-dependencies-url]
[![devdependencies][chdir-promise-devdependencies-image] ][chdir-promise-devdependencies-url]
[![semantic-release][semantic-image] ][semantic-url]

```js
var chdir = require('chdir-promise');
Expand Down Expand Up @@ -53,8 +52,8 @@ chdir.to('foo/bar/folder')
Author: Gleb Bahmutov © 2014

* [@bahmutov](https://twitter.com/bahmutov)
* [glebbahmutov.com](http://glebbahmutov.com)
* [blog](http://bahmutov.calepin.co/)
* [glebbahmutov.com](https://glebbahmutov.com)
* [blog](https://glebbahmutov.com/blog/)

License: MIT - do anything with the code, but don't blame me if it does not work.

Expand Down Expand Up @@ -92,7 +91,5 @@ OTHER DEALINGS IN THE SOFTWARE.
[chdir-promise-url]: https://npmjs.org/package/chdir-promise
[chdir-promise-ci-image]: https://travis-ci.org/bahmutov/chdir-promise.png?branch=master
[chdir-promise-ci-url]: https://travis-ci.org/bahmutov/chdir-promise
[chdir-promise-dependencies-image]: https://david-dm.org/bahmutov/chdir-promise.png
[chdir-promise-dependencies-url]: https://david-dm.org/bahmutov/chdir-promise
[chdir-promise-devdependencies-image]: https://david-dm.org/bahmutov/chdir-promise/dev-status.png
[chdir-promise-devdependencies-url]: https://david-dm.org/bahmutov/chdir-promise#info=devDependencies
[semantic-image]: https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg
[semantic-url]: https://github.com/semantic-release/semantic-release
5 changes: 3 additions & 2 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ var check = require('check-more-types');
var q = require('q');
var fs = require('fs');
var S = require('spots');
var debug = require('debug')('chdir-promise');

// stack
var folders = [];
Expand All @@ -14,7 +15,7 @@ function _to(folderName) {
var current = process.cwd();
la(check.unemptyString(folderName), 'missing folder');
process.chdir(folderName);
console.log('in folder', process.cwd());
debug('chdir to folder', process.cwd());

folders.push(current);

Expand All @@ -27,7 +28,7 @@ function comeBack() {
}
var folder = folders.pop();
process.chdir(folder);
console.log('restored folder', folder);
debug('restored folder', folder);
return folder;
}

Expand Down
9 changes: 6 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
{
"name": "chdir-promise",
"version": "0.2.1",
"version": "0.0.0-development",
"description": "Change working dir and return a promise, a stack of folders is maintained to jump back",
"main": "index.js",
"scripts": {
"test": "node test/chdir-promise-spec.js"
"test": "node test/chdir-promise-spec.js",
"semantic-release": "semantic-release pre && npm publish && semantic-release post"
},
"repository": {
"type": "git",
Expand All @@ -30,12 +31,14 @@
"dependencies": {
"check-more-types": "1.1.1",
"check-types": "1.4.0",
"debug": "^2.3.3",
"lazy-ass": "0.5.3",
"q": "1.1.2",
"spots": "0.4.0"
},
"devDependencies": {
"pre-git": "0.1.1"
"pre-git": "0.1.1",
"semantic-release": "^6.3.2"
},
"pre-commit": "npm test"
}

0 comments on commit 2491019

Please sign in to comment.