Skip to content

Commit 0773f64

Browse files
committed
more diagnostics, but mostly fix my stupid bug lol
1 parent ba56852 commit 0773f64

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

packages/site-kit/src/lib/markdown/renderer.ts

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import MagicString from 'magic-string';
22
import { createHash, Hash } from 'node:crypto';
33
import fs from 'node:fs';
4+
import process from 'node:process';
45
import path from 'node:path';
56
import ts from 'typescript';
67
import * as marked from 'marked';
@@ -34,8 +35,13 @@ const hash = createHash('sha256');
3435
hash.update(fs.readFileSync('../../pnpm-lock.yaml', 'utf-8'));
3536
// CAREFUL: update this URL in case you ever move this file or start the dev/build process from another directory
3637
const original_file = '../../packages/site-kit/src/lib/markdown/renderer.ts';
37-
if (fs.existsSync(original_file)) {
38-
throw new Error('Update the path to the markdown renderer code. Current value: ' + original_file);
38+
if (!fs.existsSync(original_file)) {
39+
throw new Error(
40+
'Update the path to the markdown renderer code. Current value: ' +
41+
original_file +
42+
' | Current cwd: ' +
43+
process.cwd()
44+
);
3945
}
4046
hash_graph(hash, fileURLToPath(original_file));
4147
const digest = hash.digest().toString('base64').replace(/\//g, '-');

0 commit comments

Comments
 (0)