76a9e7a0cc
Automation / Format (push) Waiting to run
Automation / File Labeler (push) Waiting to run
Automation / Gemini Reviewed (push) Waiting to run
Coverage / Coverage (push) Waiting to run
Publish OpenClaw Skills / publish (push) Has been cancelled
Audit / Security Audit (push) Has been cancelled
Automation / Gemini Review (push) Has been cancelled
CI / Detect Changes (push) Has been cancelled
CI / Test (macos-latest) (push) Has been cancelled
CI / Test (ubuntu-latest) (push) Has been cancelled
CI / Nix (push) Has been cancelled
CI / Lint (push) Has been cancelled
CI / Cargo Deny (push) Has been cancelled
CI / Verify Skills (push) Has been cancelled
CI / Lint Skills (push) Has been cancelled
CI / Build (Linux x86_64) (push) Has been cancelled
CI / Build (macos-latest, aarch64-apple-darwin) (push) Has been cancelled
CI / Build (macos-latest, x86_64-apple-darwin) (push) Has been cancelled
CI / Build (ubuntu-latest, aarch64-unknown-linux-gnu) (push) Has been cancelled
CI / Build (windows-latest, x86_64-pc-windows-msvc) (push) Has been cancelled
CI / API Smoketest (push) Has been cancelled
Policy / Policy Check (push) Has been cancelled
Release (Changeset) / Release (push) Has been cancelled
37 lines
852 B
JavaScript
37 lines
852 B
JavaScript
#!/usr/bin/env node
|
|
|
|
"use strict";
|
|
|
|
const path = require("path");
|
|
const fs = require("fs");
|
|
const { spawnSync } = require("child_process");
|
|
const { getPlatform } = require("./platform");
|
|
|
|
const platform = getPlatform();
|
|
const binPath = path.join(__dirname, "bin", platform.binary);
|
|
|
|
if (!fs.existsSync(binPath)) {
|
|
console.error(
|
|
`gws binary not found at ${binPath}\nAuto-installing...`
|
|
);
|
|
const install = spawnSync(process.execPath, [path.join(__dirname, "install.js")], {
|
|
cwd: __dirname,
|
|
stdio: "inherit",
|
|
});
|
|
if (install.status !== 0) {
|
|
process.exit(install.status ?? 1);
|
|
}
|
|
}
|
|
|
|
const result = spawnSync(binPath, process.argv.slice(2), {
|
|
cwd: process.cwd(),
|
|
stdio: "inherit",
|
|
});
|
|
|
|
if (result.error) {
|
|
console.error(`Error running gws: ${result.error.message}`);
|
|
process.exit(1);
|
|
}
|
|
|
|
process.exit(result.status ?? 1);
|