@factuarea/cli 0.1.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.
- package/bin/factuarea.js +24 -0
- package/package.json +27 -0
package/bin/factuarea.js
ADDED
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
"use strict";
|
|
3
|
+
const { spawnSync } = require("node:child_process");
|
|
4
|
+
|
|
5
|
+
const platformKey = `${process.platform}-${process.arch}`;
|
|
6
|
+
const pkg = `@factuarea/cli-${platformKey}`;
|
|
7
|
+
|
|
8
|
+
let binary;
|
|
9
|
+
try {
|
|
10
|
+
binary = require.resolve(`${pkg}/factuarea${process.platform === "win32" ? ".exe" : ""}`);
|
|
11
|
+
} catch {
|
|
12
|
+
console.error(
|
|
13
|
+
`factuarea: no se encontró el binario para tu plataforma (${platformKey}).\n` +
|
|
14
|
+
`Instala el paquete específico o usa otro método: https://github.com/factuarea/factuarea-cli`
|
|
15
|
+
);
|
|
16
|
+
process.exit(1);
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
const res = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
|
|
20
|
+
if (res.error) {
|
|
21
|
+
console.error(res.error.message);
|
|
22
|
+
process.exit(1);
|
|
23
|
+
}
|
|
24
|
+
process.exit(res.status === null ? 1 : res.status);
|
package/package.json
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@factuarea/cli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "CLI oficial de Factuarea para la API pública v1",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://github.com/factuarea/factuarea-cli",
|
|
7
|
+
"repository": {
|
|
8
|
+
"type": "git",
|
|
9
|
+
"url": "git+https://github.com/factuarea/factuarea-cli.git"
|
|
10
|
+
},
|
|
11
|
+
"bin": {
|
|
12
|
+
"factuarea": "bin/factuarea.js"
|
|
13
|
+
},
|
|
14
|
+
"files": [
|
|
15
|
+
"bin/factuarea.js"
|
|
16
|
+
],
|
|
17
|
+
"optionalDependencies": {
|
|
18
|
+
"@factuarea/cli-darwin-arm64": "0.1.0",
|
|
19
|
+
"@factuarea/cli-darwin-x64": "0.1.0",
|
|
20
|
+
"@factuarea/cli-linux-arm64": "0.1.0",
|
|
21
|
+
"@factuarea/cli-linux-x64": "0.1.0",
|
|
22
|
+
"@factuarea/cli-win32-x64": "0.1.0"
|
|
23
|
+
},
|
|
24
|
+
"engines": {
|
|
25
|
+
"node": ">=20"
|
|
26
|
+
}
|
|
27
|
+
}
|