Skip to content

Commit d42325d

Browse files
committed
fix: path in scripts
1 parent c161536 commit d42325d

File tree

4 files changed

+11
-10
lines changed

4 files changed

+11
-10
lines changed

package.json

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,8 +25,8 @@
2525
"scripts:build": "yarn workspace scripts build",
2626
"scripts:lint": "yarn workspace scripts lint",
2727
"scripts:test": "yarn workspace scripts test",
28-
"specs:fix": "eslint --ext=yml specs/$0 --fix",
29-
"specs:lint": "eslint --ext=yml specs/$0",
28+
"specs:fix": "eslint --ext=yml $0 --fix",
29+
"specs:lint": "eslint --ext=yml $0",
3030
"website": "cd website && yarn start",
3131
"website:build": "bash scripts/website/build.sh"
3232
},

scripts/ci/codegen/pushToRepository.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ async function handleSpecFiles(spec: SpecsToPush, tempGitDir: string): Promise<v
3131
await run(`cp ${toAbsolutePath('docs/bundled/*.yml')} ${pathToSpecs}`);
3232
await run(`cp ${toAbsolutePath('docs/versions-history-with-sla-and-support-policy.json')} ${pathToSpecs}`);
3333
// adblock extensions ban words like `analytics` so we use a different file name just so the doc dans render it
34-
await run(`mv ${pathToSpecs}/analytics.doc.yml ${pathToSpecs}/searchstats.doc.yml`);
34+
await run(`mv ${pathToSpecs}/analytics.yml ${pathToSpecs}/searchstats.yml`);
3535
}
3636

3737
async function handleGuideFiles(guide: GuidesToPush, tempGitDir: string): Promise<void> {

scripts/specs/format.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ export async function lintCommon(useCache: boolean): Promise<void> {
2626
return;
2727
}
2828

29-
await run('yarn specs:lint common');
29+
await run('yarn specs:lint specs/common');
3030

3131
if (useCache) {
3232
spinner.text = 'storing common spec cache';

scripts/specs/index.ts

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)