Skip to content

Commit

Permalink
Remove directory argument
Browse files Browse the repository at this point in the history
  • Loading branch information
michaelrhodes committed Feb 1, 2018
1 parent 6476401 commit 310e854
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 6 deletions.
11 changes: 7 additions & 4 deletions index.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,14 @@ var path = require('path')

module.exports = zcc

function zcc (dir, parse) {
function zcc (parse) {
var file = process.argv[2]
var cmd = file && path.join(dir,
basename(file) + '.js'
)

var dir = module.parent &&
path.dirname(module.parent.filename)

var cmd = file && dir &&
path.join(dir, basename(file) + '.js')

if (!cmd || !fs.existsSync(cmd)) {
var pkg = require(path.join(dir, 'package.json'))
Expand Down
4 changes: 2 additions & 2 deletions readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ $ npm install michaelrhodes/zcc#1.1.0
```js
// bin.js
#!/usr/bin/env node
require('zcc')(__dirname)
require('zcc')()

// hello.js
module.exports = function (name) {
Expand All @@ -29,7 +29,7 @@ chmod u+x bin.js
```js
// bin.js
#!/usr/bin/env node
require('zcc')(__dirname, require('mri'))
require('zcc')(require('mri'))

// hello.js
module.exports = function (args) {
Expand Down

0 comments on commit 310e854

Please sign in to comment.