Skip to content

Commit 22e132d

Browse files
committed
refactor(linter/plugins): shorten build script (#15943)
Pure refactor. Just tidy up the build script a little.
1 parent 84d1f4f commit 22e132d

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

apps/oxlint/scripts/build.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import { copyFileSync, readdirSync, readFileSync, writeFileSync } from 'node:fs'
33
import { join } from 'node:path';
44

55
const oxlintDirPath = join(import.meta.dirname, '..'),
6+
srcDirPath = join(oxlintDirPath, 'src-js'),
67
distDirPath = join(oxlintDirPath, 'dist'),
78
debugDirPath = join(oxlintDirPath, 'debug');
89

@@ -22,12 +23,11 @@ execSync('pnpm tsdown', { stdio: 'inherit', cwd: oxlintDirPath });
2223

2324
// Copy native `.node` files from `src-js`
2425
console.log('Copying `.node` files...');
25-
26-
const srcDirPath = join(oxlintDirPath, 'src-js');
2726
for (const filename of readdirSync(srcDirPath)) {
2827
if (!filename.endsWith('.node')) continue;
29-
copyFileSync(join(srcDirPath, filename), join(distDirPath, filename));
30-
copyFileSync(join(srcDirPath, filename), join(debugDirPath, filename));
28+
const srcPath = join(srcDirPath, filename);
29+
copyFileSync(srcPath, join(distDirPath, filename));
30+
copyFileSync(srcPath, join(debugDirPath, filename));
3131
}
3232

3333
console.log('Build complete!');

0 commit comments

Comments
 (0)