@share2us/cli
Version:
Share2Us CLI (s2u) — share files and text from your terminal, browser, or AI agent via one opaque, expiring link.
27 lines (22 loc) • 832 B
JavaScript
// Thin launcher: exec the native Share2Us CLI binary that install.js placed here.
;
const fs = require("fs");
const path = require("path");
const { spawnSync } = require("child_process");
const bin = path.join(
__dirname,
process.platform === "win32" ? "share2us-bin.exe" : "share2us-bin"
);
if (!fs.existsSync(bin)) {
console.error("share2us: the CLI binary is missing (install scripts may have been skipped).");
console.error("Reinstall with `npm i -g @share2us/cli`, or run:");
console.error(" node " + path.join(__dirname, "..", "install.js"));
process.exit(1);
}
const res = spawnSync(bin, process.argv.slice(2), { stdio: "inherit" });
if (res.error) {
console.error("share2us: " + res.error.message);
process.exit(1);
}
process.exit(res.status === null ? 1 : res.status);