Comparing version 0.1.8 to 0.2.0
@@ -10,2 +10,8 @@ # Changelog | ||
## [0.2.0] - 2023-08-17 | ||
### Removed | ||
- Building Javy from source code by using the `FORCE_FROM_SOURCE` environment variable is no longer supported. | ||
## [0.1.8] - 2023-07-28 | ||
@@ -15,2 +21,2 @@ | ||
- HTTP response status codes other than 200 when downloading Javy binary now throws an error | ||
- HTTP response status codes other than 200 when downloading Javy binary now throws an error. |
31
index.js
@@ -18,7 +18,3 @@ #!/usr/bin/env node | ||
if (!(await isBinaryDownloaded(version))) { | ||
if (process.env.FORCE_FROM_SOURCE) { | ||
await buildBinary(version); | ||
} else { | ||
await downloadBinary(version); | ||
} | ||
await downloadBinary(version); | ||
} | ||
@@ -169,26 +165,1 @@ const result = childProcess.spawnSync(binaryPath(version), getArgs(), { | ||
} | ||
async function buildBinary(version) { | ||
const repoDir = cacheDir("build", NAME); | ||
try { | ||
console.log(`Downloading ${NAME}'s source code...`); | ||
fs.rmSync(repoDir, { recursive: true }); | ||
childProcess.execSync( | ||
`git clone https://github.com/${REPO} ${repoDir}` | ||
); | ||
console.log(`Building ${NAME}...`); | ||
childProcess.execSync("make", { cwd: repoDir }); | ||
} catch (e) { | ||
console.error(e); | ||
console.error(""); | ||
console.error(`BUILDING ${NAME} FAILED`); | ||
console.error( | ||
"Please make sure you have cmake, Rust with the wasm32-wasi target, wasmtime-cli and cargo-wasi installed" | ||
); | ||
console.error("See the README for more details."); | ||
} | ||
await fs.promises.rename( | ||
path.join(repoDir, "target", "release", NAME), | ||
binaryPath(version) | ||
); | ||
} |
{ | ||
"name": "javy-cli", | ||
"version": "0.1.8", | ||
"version": "0.2.0", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -30,19 +30,1 @@ # Javy npm package | ||
``` | ||
## Building from source | ||
If there are no binaries available for your platform or the available binaries | ||
don't work for you for some reason, the npm package can also build Javy from | ||
source. | ||
``` | ||
FORCE_FROM_SOURCE=1 npx javy-cli@latest | ||
``` | ||
Please note that for this to work you must have all prerequisites of Javy | ||
(listed in the [README]) installed. (That is CMake, Rust, Rust for wasm32-wasi | ||
target, cargo wasi, wasmtime-cli and Rosetta on Mac M1). | ||
[README]: https://github.com/bytecodealliance/javy/blob/main/README.md | ||
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
4
6426
149
30