@@ -75,11 +75,12 @@ async function buildSpec({
7575 const specBase = isLiteSpec ? 'search' : spec ;
7676 const deps = isLiteSpec ? [ 'search' , 'recommend' ] : [ spec ] ;
7777 const logSuffix = docs ? 'doc spec' : 'spec' ;
78+ const basePath = docs ? 'docs/' : 'specs/' ;
7879 const cache = new Cache ( {
79- folder : toAbsolutePath ( 'specs/' ) ,
80- generatedFiles : [ docs ? `bundled/ ${ spec } .doc.yml` : `bundled/ ${ spec } .yml`] ,
80+ folder : toAbsolutePath ( basePath ) ,
81+ generatedFiles : [ ` ${ spec } .yml`] ,
8182 filesToCache : [ ...deps , 'common' ] ,
82- cacheFile : toAbsolutePath ( `specs /dist/${ spec } .${ docs ? 'doc.' : '' } cache` ) ,
83+ cacheFile : toAbsolutePath ( `${ basePath } /dist/${ spec } .cache` ) ,
8384 } ) ;
8485
8586 const spinner = createSpinner ( `starting '${ spec } ' ${ logSuffix } ` ) ;
@@ -97,10 +98,10 @@ async function buildSpec({
9798
9899 // First linting the base
99100 spinner . text = `linting '${ spec } ' ${ logSuffix } ` ;
100- await run ( `yarn specs:fix ${ specBase } ` ) ;
101+ await run ( `yarn specs:fix specs/ ${ specBase } ` ) ;
101102
102103 // Then bundle the file
103- const bundledPath = toAbsolutePath ( `specs /bundled/${ spec } .${ docs ? 'doc.' : '' } ${ outputFormat } ` ) ;
104+ const bundledPath = toAbsolutePath ( `${ basePath } /bundled/${ spec } .${ outputFormat } ` ) ;
104105 await run ( `yarn openapi bundle specs/${ specBase } /spec.yml -o ${ bundledPath } --ext ${ outputFormat } ` ) ;
105106
106107 if ( ! ( await exists ( bundledPath ) ) ) {
@@ -123,7 +124,7 @@ async function buildSpec({
123124 await run ( `yarn openapi lint ${ bundledPath } ` ) ;
124125
125126 spinner . text = `linting '${ spec } ' ${ logSuffix } ` ;
126- await run ( `yarn specs:fix bundled/${ spec } .${ docs ? 'doc.' : '' } ${ outputFormat } ` ) ;
127+ await run ( `yarn specs:fix ${ basePath } / bundled/${ spec } .${ outputFormat } ` ) ;
127128
128129 if ( useCache ) {
129130 spinner . text = `storing '${ spec } ' ${ logSuffix } ` ;
0 commit comments