dev: copy backend-rs/index.{js,d.ts} to built/index.{js,d.ts} if not exist
https://firefish.dev/firefish/firefish/-/merge_requests/10780#note_5685
This commit is contained in:
parent
ecd8e3d109
commit
0c4826becf
1 changed files with 15 additions and 0 deletions
|
@ -1,6 +1,7 @@
|
||||||
import path, { join } from "node:path";
|
import path, { join } from "node:path";
|
||||||
import { fileURLToPath } from "node:url";
|
import { fileURLToPath } from "node:url";
|
||||||
import { execa } from "execa";
|
import { execa } from "execa";
|
||||||
|
import fs from "node:fs";
|
||||||
|
|
||||||
(async () => {
|
(async () => {
|
||||||
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
||||||
|
@ -32,4 +33,18 @@ import { execa } from "execa";
|
||||||
stdio: "inherit",
|
stdio: "inherit",
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (!fs.existsSync(join(__dirname, "/../packages/backend-rs/built/index.js"))) {
|
||||||
|
fs.copyFileSync(
|
||||||
|
join(__dirname, "/../packages/backend-rs/index.js"),
|
||||||
|
join(__dirname, "/../packages/backend-rs/built/index.js"),
|
||||||
|
);
|
||||||
|
console.warn("backend-rs/built/index.js has not been updated (https://github.com/napi-rs/napi-rs/issues/1768)");
|
||||||
|
}
|
||||||
|
if (!fs.existsSync(join(__dirname, "/../packages/backend-rs/built/index.d.ts"))) {
|
||||||
|
fs.copyFileSync(
|
||||||
|
join(__dirname, "/../packages/backend-rs/index.d.ts"),
|
||||||
|
join(__dirname, "/../packages/backend-rs/built/index.d.ts"),
|
||||||
|
);
|
||||||
|
}
|
||||||
})();
|
})();
|
||||||
|
|
Loading…
Reference in a new issue