mirror of
https://github.com/denoland/deno.git
synced 2024-11-22 15:06:54 -05:00
b560246f30
<!-- Before submitting a PR, please read http://deno.land/manual/contributing 1. Give the PR a descriptive title. Examples of good title: - fix(std/http): Fix race condition in server - docs(console): Update docstrings - feat(doc): Handle nested reexports Examples of bad title: - fix #7123 - update docs - fix bugs 2. Ensure there is a related issue and it is referenced in the PR text. 3. Ensure there are tests that cover the changes. 4. Ensure `cargo test` passes. 5. Ensure `./tools/format.js` passes without changing files. 6. Ensure `./tools/lint.js` passes. -->
24 lines
760 B
JavaScript
Executable file
24 lines
760 B
JavaScript
Executable file
#!/usr/bin/env -S deno run --unstable --allow-read --allow-write
|
|
// Copyright 2018-2022 the Deno authors. All rights reserved. MIT license.
|
|
|
|
import exports from "../../cli/napi_sym/symbol_exports.json" assert {
|
|
type: "json",
|
|
};
|
|
|
|
const symbolExportLists = {
|
|
linux: `{ ${exports.symbols.map((s) => `"${s}"`).join("; ")}; };`,
|
|
windows: `LIBRARY\nEXPORTS\n${
|
|
exports.symbols
|
|
.map((symbol) => " " + symbol)
|
|
.join("\n")
|
|
}`,
|
|
macos: exports.symbols.map((symbol) => "_" + symbol).join("\n"),
|
|
};
|
|
|
|
for await (const [os, def] of Object.entries(symbolExportLists)) {
|
|
const defUrl = new URL(
|
|
`../../cli/generated_symbol_exports_list_${os}.def`,
|
|
import.meta.url,
|
|
);
|
|
await Deno.writeTextFile(defUrl.pathname, def, { create: true });
|
|
}
|