Skip to content

Commit

Permalink
chore: allow running pre-build without SHA target (#686)
Browse files Browse the repository at this point in the history
  • Loading branch information
erickzhao authored Nov 26, 2024
1 parent 131691a commit 0911cc5
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
7 changes: 4 additions & 3 deletions docusaurus.config.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import fs from 'fs';
import path from 'path';
import fs from 'node:fs';
import path from 'node:path';

import logger from '@docusaurus/logger';
import { Config } from '@docusaurus/types';
import npm2yarn from '@docusaurus/remark-plugin-npm2yarn';
import { themes as prismThemes } from 'prism-react-renderer';
Expand All @@ -25,7 +26,7 @@ try {
'utf-8'
);
} catch {
console.warn('No .sha file found in docs/latest directory');
logger.warn('No .sha file found in docs/latest directory');
}

const config: Config = {
Expand Down
3 changes: 1 addition & 2 deletions scripts/pre-build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -53,8 +53,7 @@ const start = async (source: string): Promise<void> => {
destination: DOCS_FOLDER,
downloadMatch: '/docs/',
});

await fs.writeFile(path.join(DOCS_FOLDER, '.sha'), source);
await fs.writeFile(path.join(DOCS_FOLDER, '.sha'), target);
} else if (existsSync(source)) {
await copy({
target: source,
Expand Down

0 comments on commit 0911cc5

Please sign in to comment.