@@ -13,9 +13,9 @@ import getReleases, {
1313 ReleaseFilter
1414} from '../src/commands/getReleases' ;
1515import { join , resolve } from 'path' ;
16- import { mkdtempSync } from 'fs' ;
1716import installDependencies from '../src/commands/installDependencies' ;
1817import { logger } from '../src/log' ;
18+ import { makeTempDirectory } from '../src/util/file' ;
1919
2020interface BaseOptions {
2121 dest : string ;
@@ -80,10 +80,6 @@ function getFilterOptions(filter?: RemoteApiOptions['filter']): ReleaseFilter[]
8080 return [ filter ] ;
8181}
8282
83- function createTempDirectory ( name : string = '' ) : string {
84- return mkdtempSync ( join ( '.sync' , name ) ) ;
85- }
86-
8783export = function ( grunt : IGrunt ) {
8884 async function typedocTask ( this : IMultiTask < any > ) {
8985 const options : any = this . options < Partial < TaskOptions > > ( {
@@ -101,7 +97,8 @@ export = function (grunt: IGrunt) {
10197
10298 if ( isRemoteOptions ( options ) ) {
10399 const repo = getGitHub ( options . repo ) ;
104- const cloneDirectory = options . cloneDirectory ? options . cloneDirectory : createTempDirectory ( repo . name ) ;
100+ const cloneDirectory = options . cloneDirectory ?
101+ options . cloneDirectory : makeTempDirectory ( join ( '.sync' , repo . name ) ) ;
105102 const missing = await getMissing ( repo , options ) ;
106103 const pathTemplate = format === 'json' ? getJsonApiPath : getHtmlApiPath ;
107104
0 commit comments