@griffinwork40/gadscli 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/gadscli-darwin-arm64 +0 -0
- package/package.json +28 -0
- package/src/index.js +40 -0
|
Binary file
|
package/package.json
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@griffinwork40/gadscli",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "A fast, ergonomic CLI for the Google Ads API, written in Rust.",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"bin": {
|
|
7
|
+
"gadscli": "src/index.js"
|
|
8
|
+
},
|
|
9
|
+
"files": [
|
|
10
|
+
"src",
|
|
11
|
+
"bin"
|
|
12
|
+
],
|
|
13
|
+
"keywords": [
|
|
14
|
+
"google-ads",
|
|
15
|
+
"google-ads-api",
|
|
16
|
+
"cli",
|
|
17
|
+
"gaql",
|
|
18
|
+
"ppc",
|
|
19
|
+
"advertising"
|
|
20
|
+
],
|
|
21
|
+
"repository": {
|
|
22
|
+
"type": "git",
|
|
23
|
+
"url": "https://github.com/graisol/google-ads-cli"
|
|
24
|
+
},
|
|
25
|
+
"engines": {
|
|
26
|
+
"node": ">=14"
|
|
27
|
+
}
|
|
28
|
+
}
|
package/src/index.js
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const { execFileSync } = require("child_process");
|
|
4
|
+
const path = require("path");
|
|
5
|
+
const os = require("os");
|
|
6
|
+
|
|
7
|
+
const PLATFORMS = {
|
|
8
|
+
"darwin-arm64": "gadscli-darwin-arm64",
|
|
9
|
+
"darwin-x64": "gadscli-darwin-x64",
|
|
10
|
+
"linux-x64": "gadscli-linux-x64-gnu",
|
|
11
|
+
"linux-arm64": "gadscli-linux-arm64-gnu",
|
|
12
|
+
"win32-x64": "gadscli-win32-x64-msvc",
|
|
13
|
+
};
|
|
14
|
+
|
|
15
|
+
const platform = os.platform();
|
|
16
|
+
const arch = os.arch();
|
|
17
|
+
const key = `${platform}-${arch}`;
|
|
18
|
+
const name = PLATFORMS[key];
|
|
19
|
+
|
|
20
|
+
if (!name) {
|
|
21
|
+
console.error(
|
|
22
|
+
`Unsupported platform: ${key}. Supported: ${Object.keys(PLATFORMS).join(", ")}`
|
|
23
|
+
);
|
|
24
|
+
process.exit(1);
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const ext = platform === "win32" ? ".exe" : "";
|
|
28
|
+
const binPath = path.join(__dirname, "..", "bin", `${name}${ext}`);
|
|
29
|
+
|
|
30
|
+
try {
|
|
31
|
+
execFileSync(binPath, process.argv.slice(2), {
|
|
32
|
+
stdio: "inherit",
|
|
33
|
+
env: process.env,
|
|
34
|
+
});
|
|
35
|
+
} catch (e) {
|
|
36
|
+
if (e.status !== undefined) {
|
|
37
|
+
process.exit(e.status);
|
|
38
|
+
}
|
|
39
|
+
throw e;
|
|
40
|
+
}
|