Skip to content

Commit

Permalink
Interrogate system for node .bin location
Browse files Browse the repository at this point in the history
  • Loading branch information
notmessenger committed Feb 27, 2017
1 parent b67157a commit 86f45eb
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
Binary file added .DS_Store
Binary file not shown.
4 changes: 3 additions & 1 deletion lib/commands/ember-cli-jsdoc.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,18 @@
'use strict';

var exec = require( 'child_process' ).exec;
var execSync = require( 'child_process' ).execSync;
var rsvp = require( 'rsvp' );
var path = require( 'path' );
var chalk = require( 'chalk' );
var nodeBinPath = execSync( 'npm bin' );

module.exports = {
name: 'ember-cli-jsdoc',

run: function() {
var cmdPath = ( Number( process.version.match( /^v(\d+)/ )[1] ) >= 5 ) ?
path.join( 'node_modules', '.bin', 'jsdoc' ) :
path.join( nodeBinPath.toString('utf8').trim(), 'jsdoc' ) :
path.join( 'node_modules', 'ember-cli-jsdoc', 'node_modules', '.bin', 'jsdoc' );

return new rsvp.Promise( function( resolve, reject ) {
Expand Down

0 comments on commit 86f45eb

Please sign in to comment.