Skip to content

Commit c900783

Browse files
Rich HarrisIvan Hofer
authored andcommitted
simplify script
1 parent 6650624 commit c900783

File tree

2 files changed

+6
-9
lines changed

2 files changed

+6
-9
lines changed

packages/kit/scripts/update_version.js

Lines changed: 5 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,12 @@
1-
import { readFile, writeFile } from 'node:fs/promises';
2-
import { resolve } from 'node:path';
1+
import fs from 'node:fs';
32
import { fileURLToPath } from 'node:url';
43

5-
const __dirname = fileURLToPath(new URL('.', import.meta.url));
6-
const pathToPackageJson = resolve(__dirname, '..', 'package.json');
7-
const pathToVersionModule = resolve(__dirname, '..', 'src', 'version.js');
4+
process.chdir(fileURLToPath(new URL('..', import.meta.url)));
85

9-
const pkg = JSON.parse(await readFile(pathToPackageJson, { encoding: 'utf-8' }));
6+
const pkg = JSON.parse(fs.readFileSync('package.json', 'utf-8'));
107

11-
await writeFile(
12-
pathToVersionModule,
8+
fs.writeFileSync(
9+
'src/version.js',
1310
`// This file get's auto-updated on each release. Please don't edit it manually.
1411
export const VERSION = '${pkg.version}';
1512
`

packages/kit/src/version.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,2 @@
1-
// This file is auto-updated on each release. Please don't edit it manually.
1+
// This file get's auto-updated on each release. Please don't edit it manually.
22
export const VERSION = '1.18.0';

0 commit comments

Comments
 (0)