@devopsdaily/devops-daily-cli 0.0.0-stage → 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/README.md CHANGED
@@ -1,3 +1,10 @@
1
- # Temporary Holding Version
1
+ # DevOps Daily CLI
2
2
 
3
- This version is a temporary placeholder for this package. An operational version to replace this has been submitted for review and is awaiting a staged release.
3
+ Learn DevOps from your terminal.
4
+
5
+ ```sh
6
+ npx @devopsdaily/devops-daily-cli
7
+ devops-daily version
8
+ ```
9
+
10
+ Install globally with `npm install -g @devopsdaily/devops-daily-cli`.
@@ -0,0 +1,32 @@
1
+ #!/usr/bin/env node
2
+ "use strict";
3
+
4
+ const { spawnSync } = require("child_process");
5
+ const { packageFor } = require("./platform");
6
+
7
+ const packageName = packageFor(process.platform, process.arch);
8
+ if (!packageName) {
9
+ console.error(`devops-daily does not support ${process.platform}/${process.arch}.`);
10
+ console.error("Use the install script or a release archive instead.");
11
+ process.exit(1);
12
+ }
13
+
14
+ const binaryName = process.platform === "win32" ? "devops-daily.exe" : "devops-daily";
15
+ let binary;
16
+ try {
17
+ binary = require.resolve(`${packageName}/bin/${binaryName}`);
18
+ } catch (_) {
19
+ console.error(`The optional package ${packageName} is missing.`);
20
+ console.error("Reinstall without --no-optional or --omit=optional, or use the install script.");
21
+ process.exit(1);
22
+ }
23
+
24
+ const result = spawnSync(binary, process.argv.slice(2), { stdio: "inherit" });
25
+ if (result.error) {
26
+ console.error(`Could not run devops-daily: ${result.error.message}`);
27
+ process.exit(1);
28
+ }
29
+ if (result.signal) {
30
+ process.kill(process.pid, result.signal);
31
+ }
32
+ process.exit(result.status === null ? 1 : result.status);
@@ -0,0 +1,13 @@
1
+ "use strict";
2
+
3
+ const packageFor = (platform, arch) => {
4
+ const supported = {
5
+ darwin: { x64: "darwin-x64", arm64: "darwin-arm64" },
6
+ linux: { x64: "linux-x64", arm64: "linux-arm64" },
7
+ win32: { x64: "win32-x64", arm64: "win32-arm64" },
8
+ };
9
+ const target = supported[platform] && supported[platform][arch];
10
+ return target ? `@devopsdaily/devops-daily-cli-${target}` : null;
11
+ };
12
+
13
+ module.exports = { packageFor };
package/package.json CHANGED
@@ -1,6 +1,37 @@
1
1
  {
2
2
  "name": "@devopsdaily/devops-daily-cli",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.1.0",
4
+ "description": "Learn DevOps from your terminal",
5
+ "bin": {
6
+ "devops-daily": "bin/devops-daily.js",
7
+ "ddy": "bin/devops-daily.js"
8
+ },
9
+ "optionalDependencies": {
10
+ "@devopsdaily/devops-daily-cli-linux-x64": "0.1.0",
11
+ "@devopsdaily/devops-daily-cli-linux-arm64": "0.1.0",
12
+ "@devopsdaily/devops-daily-cli-darwin-x64": "0.1.0",
13
+ "@devopsdaily/devops-daily-cli-darwin-arm64": "0.1.0",
14
+ "@devopsdaily/devops-daily-cli-win32-x64": "0.1.0",
15
+ "@devopsdaily/devops-daily-cli-win32-arm64": "0.1.0"
16
+ },
17
+ "engines": {
18
+ "node": ">=18"
19
+ },
20
+ "repository": {
21
+ "type": "git",
22
+ "url": "git+https://github.com/The-DevOps-Daily/devops-daily-cli.git"
23
+ },
24
+ "homepage": "https://devops-daily.com",
25
+ "license": "MIT",
26
+ "keywords": [
27
+ "devops",
28
+ "learning",
29
+ "cli",
30
+ "quiz",
31
+ "flashcards"
32
+ ],
33
+ "files": [
34
+ "bin/",
35
+ "README.md"
36
+ ]
37
+ }