mountable-cli 0.0.0 → 0.2.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Binary file
Binary file
Binary file
Binary file
package/bin/mountable.js CHANGED
@@ -1,4 +1,29 @@
1
1
  #!/usr/bin/env node
2
+ // Runs the mountable binary for this platform with the same arguments,
3
+ // stdio, exit code and signals.
2
4
  "use strict";
3
- console.error("Mountable CLI: install a released version, see https://mountable.io/docs");
4
- process.exit(1);
5
+ const { spawn } = require("node:child_process");
6
+ const path = require("node:path");
7
+
8
+ const target = `${process.platform}-${process.arch}`;
9
+ if (!["linux-x64", "linux-arm64", "darwin-x64", "darwin-arm64"].includes(target)) {
10
+ console.error(`mountable: ${target} is not supported; Mountable runs on Linux and macOS (x64, arm64).`);
11
+ process.exit(1);
12
+ }
13
+
14
+ const child = spawn(path.join(__dirname, `mountable-${target}`), process.argv.slice(2), { stdio: "inherit" });
15
+ // `mountable mount` unmounts on SIGINT/SIGTERM, so a signal sent to this
16
+ // launcher must reach it.
17
+ for (const signal of ["SIGINT", "SIGTERM", "SIGHUP"]) process.on(signal, () => child.kill(signal));
18
+ child.on("error", (error) => {
19
+ console.error(`mountable: ${error.message}`);
20
+ process.exit(1);
21
+ });
22
+ child.on("exit", (code, signal) => {
23
+ if (signal) {
24
+ process.removeAllListeners(signal);
25
+ process.kill(process.pid, signal);
26
+ } else {
27
+ process.exit(code);
28
+ }
29
+ });
package/package.json CHANGED
@@ -1,15 +1,19 @@
1
1
  {
2
2
  "name": "mountable-cli",
3
- "version": "0.0.0",
4
- "description": "Placeholder for the Mountable CLI; install a released version.",
3
+ "version": "0.2.0",
4
+ "description": "The Mountable CLI: mount a Mountable filesystem on Linux or macOS.",
5
5
  "homepage": "https://mountable.io/docs",
6
6
  "license": "Apache-2.0",
7
7
  "bin": {
8
8
  "mountable": "bin/mountable.js"
9
9
  },
10
10
  "files": [
11
- "bin/"
11
+ "bin/",
12
+ "THIRD_PARTY_NOTICES"
12
13
  ],
14
+ "engines": {
15
+ "node": ">=18"
16
+ },
13
17
  "repository": {
14
18
  "type": "git",
15
19
  "url": "git+https://github.com/writeitai/mountable.git"