@@ -5,11 +5,11 @@ const util = require('util')
55const a = require ( 'array-tools' )
66const o = require ( 'object-tools' )
77const fs = require ( 'fs' )
8- const mfs = require ( 'more-fs' )
98const fileSet = require ( 'file-set' )
109const Transform = require ( 'stream' ) . Transform
1110const cliOptions = require ( './cli-options' )
1211const os = require ( 'os' )
12+ const tempPath = require ( 'temp-path' )
1313
1414/**
1515 * Exports a single function to parse jsdoc data.
@@ -113,7 +113,7 @@ function jsdocParse (options) {
113113 return output
114114 } else {
115115 var inputStream = new Transform ( )
116- var inputFilePath = mfs . getTempFilePath ( ) + '.js'
116+ var inputFilePath = tempPath ( )
117117
118118 var buf = new Buffer ( 0 )
119119 inputStream . _transform = function ( chunk , enc , done ) {
@@ -136,7 +136,7 @@ function jsdocParse (options) {
136136 done ( err )
137137 }
138138 }
139- mfs . deleteFile ( inputFilePath )
139+ fs . unlinkSync ( inputFilePath )
140140 } )
141141 }
142142 return inputStream
@@ -169,7 +169,7 @@ util.inherits(OutputTransform, Transform)
169169 * Uses `publish.js` as a template and the [`plugins/parseHtml`](https://github.com/arodic/jsdoc/commit/0650ac14f2048f7e6c5968630b58dc4b007498aa) plugin.
170170 */
171171function getJsdocOutput ( src , options , done ) {
172- var jsdocTemplatePath = path . resolve ( __dirname , '..' , 'lib' )
172+ var jsdocTemplatePath = __dirname
173173 var jsdocPath = path . resolve ( __dirname , '../node_modules/.bin/jsdoc' )
174174
175175 if ( ! fs . existsSync ( jsdocPath ) ) {
@@ -189,9 +189,9 @@ function getJsdocOutput (src, options, done) {
189189 }
190190 args = args . concat ( src )
191191
192- var outputFilePath = os . tmpdir ( ) + '/jsdoc-stdout.json'
192+ var outputFilePath = tempPath ( )
193193 var outputFile = fs . openSync ( outputFilePath , 'w' )
194- var outputStderrPath = os . tmpdir ( ) + '/jsdoc-stderr.json'
194+ var outputStderrPath = tempPath ( )
195195 var outputStderr = fs . openSync ( outputStderrPath , 'w' )
196196 var handle = cp . spawn ( 'node' , args , { stdio : [ process . stdin , outputFile , outputStderr ] } )
197197 handle . on ( 'error' , done )
0 commit comments