-
Notifications
You must be signed in to change notification settings - Fork 11
Expand file tree
/
Copy pathbump.mjs
More file actions
25 lines (22 loc) · 778 Bytes
/
bump.mjs
File metadata and controls
25 lines (22 loc) · 778 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
import { exec } from "child_process";
import fs from "fs";
import { dirname, resolve } from "path";
import { fileURLToPath } from "url";
import { promisify } from "util";
const __filename = fileURLToPath(import.meta.url);
const __dirname = dirname(__filename);
const exampleDirs = fs
.readdirSync(__dirname, { withFileTypes: true })
.filter((dirent) => dirent.isDirectory() && !dirent.name.startsWith("."));
await Promise.all(
exampleDirs.map(async (dir) => {
const { name } = dir;
const path = resolve(__dirname, name);
console.log(`[${name}]: Start bump.`);
const { stderr } = await promisify(exec)(
`cd ${path} && pnpm up @milkdown/* --latest`
);
if (stderr) console.error(stderr);
console.log(`[${name}]: Bump complete.`);
})
);