File tree Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Expand file tree Collapse file tree 4 files changed +6
-8
lines changed Original file line number Diff line number Diff line change 6060 "devDependencies" : {
6161 "@compodoc/compodoc" : " ^1.1.10" ,
6262 "@types/execa" : " ^0.9.0" ,
63- "@types/mkdirp" : " ^1.0.0" ,
6463 "@types/mocha" : " ^9.0.0" ,
6564 "@types/mv" : " ^2.1.0" ,
6665 "@types/ncp" : " ^2.0.1" ,
8180 "gts" : " ^3.1.0" ,
8281 "js-green-licenses" : " ^4.0.0" ,
8382 "linkinator" : " ^4.0.0" ,
84- "mkdirp" : " ^2.0.0" ,
8583 "mocha" : " ^9.2.2" ,
8684 "mv" : " ^2.1.1" ,
8785 "ncp" : " ^2.0.0" ,
Original file line number Diff line number Diff line change 1515import * as minimist from 'yargs-parser' ;
1616import * as path from 'path' ;
1717import * as fs from 'fs' ;
18+ const { mkdir} = require ( 'fs' ) . promises ;
1819import Q from 'p-queue' ;
1920import { request , Headers } from 'gaxios' ;
2021import * as gapi from 'googleapis-common' ;
21- import * as mkdirp from 'mkdirp' ;
2222
2323export type Schema = { [ index : string ] : { } } ;
2424export const DISCOVERY_URL = 'https://www.googleapis.com/discovery/v1/apis/' ;
@@ -41,7 +41,7 @@ export interface DownloadOptions {
4141
4242// exported for mocking purposes
4343export const gfs = {
44- mkdir : async ( dir : string ) => mkdirp ( dir ) ,
44+ mkdir : async ( dir : string ) => mkdir ( dir , { recursive : true } ) ,
4545 writeFile : ( path : string , obj : { } ) => {
4646 fs . writeFileSync ( path , JSON . stringify ( obj , null , 2 ) ) ;
4747 } ,
Original file line number Diff line number Diff line change 1313// limitations under the License.
1414
1515import * as fs from 'fs' ;
16+ const { mkdir} = require ( 'fs' ) . promises ;
1617import { Schema , Schemas } from 'googleapis-common' ;
17- import * as mkdirp from 'mkdirp' ;
1818import * as nunjucks from 'nunjucks' ;
1919import * as path from 'path' ;
2020import * as util from 'util' ;
@@ -272,7 +272,7 @@ export class Generator {
272272 this . logResult ( apiDiscoveryUrl , 'Generating APIs...' ) ;
273273 const apiPath = path . join ( srcPath , 'apis' , schema . name ) ;
274274 const exportFilename = path . join ( apiPath , schema . version + '.ts' ) ;
275- await mkdirp ( path . dirname ( exportFilename ) ) ;
275+ await mkdir ( path . dirname ( exportFilename ) , { recursive : true } ) ;
276276 // populate the `method.fragment` property with samples
277277 addFragments ( schema ) ;
278278 // generate the API (ex: src/apis/youtube/v3.ts)
Original file line number Diff line number Diff line change 1212// limitations under the License.
1313
1414import * as path from 'path' ;
15- import * as mkdirp from 'mkdirp' ;
1615import * as prettier from 'prettier' ;
1716import {
1817 Schema ,
@@ -25,6 +24,7 @@ import {
2524import * as nunjucks from 'nunjucks' ;
2625import * as filters from './filters' ;
2726import * as fs from 'fs' ;
27+ const { mkdir} = require ( 'fs' ) . promises ;
2828import * as util from 'util' ;
2929
3030const writeFile = util . promisify ( fs . writeFile ) ;
@@ -73,7 +73,7 @@ export async function addFragments(schema: Schema) {
7373 */
7474export async function generateSamples ( apiPath : string , schema : Schema ) {
7575 const samplesPath = path . join ( apiPath , 'samples' , schema . version ) ;
76- await mkdirp ( samplesPath ) ;
76+ await mkdir ( samplesPath , { recursive : true } ) ;
7777 const methods = getAllMethods ( schema ) ;
7878 for ( const method of methods ) {
7979 const sampleData = getSample ( schema , method ) ;
You can’t perform that action at this time.
0 commit comments