-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ci: manually replace esbuild with target arch version
- Loading branch information
1 parent
5c79280
commit 33c8922
Showing
4 changed files
with
207 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
import fs from "node:fs/promises"; | ||
|
||
import { extract } from "tar"; | ||
|
||
import pkg from "./package.json" with { type: "json" }; | ||
|
||
const target = process.argv[2]; | ||
const version = pkg.dependencies.esbuild; | ||
const url = `https://registry.npmjs.org/@esbuild/${target}/-/${target}-${version}.tgz`; | ||
|
||
const data = await fetch(url).then((response) => response.blob()).then((blob) => blob.bytes()); | ||
|
||
await fs.writeFile("esbuild.tgz", data); | ||
await extract({ file: "esbuild.tgz", }); | ||
await fs.rm("node_modules/@esbuild", { recursive: true, force: true, }); | ||
await fs.mkdir("node_modules/@esbuild", { recursive: true, }); | ||
await fs.rename("package", `node_modules/@esbuild/${target}`); |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters