Skip to content

Commit d55eee1

Browse files
authored
fix(scripts): push to correct directories (#3211)
1 parent 8999f67 commit d55eee1

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

scripts/ci/codegen/pushToAlgoliaDoc.ts

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ import fsp from 'fs/promises';
33
import { resolve } from 'path';
44

55
import {
6-
emptyDirExceptForDotGit,
76
gitCommit,
87
run,
98
toAbsolutePath,
@@ -44,12 +43,14 @@ async function pushToAlgoliaDoc(): Promise<void> {
4443
await run(`git clone --depth 1 ${githubURL} ${tempGitDir}`);
4544
await run(`git checkout -B ${targetBranch}`, { cwd: tempGitDir });
4645

47-
const dest = toAbsolutePath(`${tempGitDir}/app_data/api/specs`);
48-
await emptyDirExceptForDotGit(dest);
49-
await run(`cp ${toAbsolutePath('specs/bundled/*.doc.yml')} ${dest}`);
50-
await run(`cp ${toAbsolutePath('config/release.config.json')} ${dest}`);
51-
await run(`cp ${toAbsolutePath('website/src/generated/*.json')} ${dest}`);
52-
await run(`cp ${toAbsolutePath('website/static/img/*-sla.png')} ${dest}`);
46+
const pathToSpecs = toAbsolutePath(`${tempGitDir}/app_data/api/specs`);
47+
const pathToImages = toAbsolutePath(`${tempGitDir}/assets/images/api`);
48+
await run(`cp ${toAbsolutePath('specs/bundled/*.doc.yml')} ${pathToSpecs}`);
49+
await run(`cp ${toAbsolutePath('config/release.config.json')} ${pathToSpecs}`);
50+
await run(`cp ${toAbsolutePath('website/src/generated/*.json')} ${pathToSpecs}`);
51+
await run(
52+
`mkdir -p ${pathToImages} && cp ${toAbsolutePath('website/static/img/*-sla.png')} ${pathToImages}`,
53+
);
5354

5455
if ((await getNbGitDiff({ head: null, cwd: tempGitDir })) === 0) {
5556
console.log(`❎ Skipping push docs because there is no change.`);

0 commit comments

Comments
 (0)