create-zebrabot 1.0.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.
Files changed (2) hide show
  1. package/index.js +67 -0
  2. package/package.json +27 -0
package/index.js ADDED
@@ -0,0 +1,67 @@
1
+ #!/usr/bin/env node
2
+
3
+ const degit = require("degit");
4
+ const fs = require("fs");
5
+ const path = require("path");
6
+
7
+ const projectName = process.argv[2] || "my-zebrabot";
8
+ const repo = "bitbucket:zebra-it/zebrabot";
9
+
10
+ function log(msg) {
11
+ console.log(msg);
12
+ }
13
+
14
+ (async () => {
15
+ log("\n========================================");
16
+ log(" ZEBRABOT STARTER KIT - INSTALLER");
17
+ log("========================================\n");
18
+
19
+ log(`šŸ“ Project name: ${projectName}`);
20
+ log("šŸ“„ Step 1/3: Downloading ZebraBot template...\n");
21
+
22
+ const emitter = degit(repo, {
23
+ cache: false,
24
+ force: true,
25
+ verbose: false
26
+ });
27
+
28
+ // Silence degit internal logs
29
+ emitter.on("info", () => {});
30
+
31
+ try {
32
+ await emitter.clone(projectName);
33
+
34
+ log("\nāœ… Download complete!");
35
+ log("āš™ļø Step 2/3: Setting up project...\n");
36
+
37
+ const projectPath = path.join(process.cwd(), projectName);
38
+
39
+ // Example setup actions (add your real ones here)
40
+ // -----------------------------------------------
41
+ // 1. Ensure folders exist
42
+ const libPath = path.join(projectPath, "lib");
43
+ if (!fs.existsSync(libPath)) {
44
+ fs.mkdirSync(libPath);
45
+ }
46
+
47
+ // 2. Create a marker file (example)
48
+ fs.writeFileSync(
49
+ path.join(projectPath, "ZEBRABOT_READY.txt"),
50
+ "ZebraBot setup completed successfully."
51
+ );
52
+
53
+ log("āœ… Setup complete!");
54
+ log("šŸŽÆ Step 3/3: Finalizing...\n");
55
+
56
+ log("šŸŽ‰ ZebraBot project is ready!");
57
+ log(`šŸ‘‰ Next steps:`);
58
+ log(` cd ${projectName}`);
59
+ log(" Open the folder in VS Code");
60
+ log(" Start coding šŸš€\n");
61
+
62
+ } catch (err) {
63
+ console.error("\nāŒ Installation failed:");
64
+ console.error(err?.message || err);
65
+ process.exit(1);
66
+ }
67
+ })();
package/package.json ADDED
@@ -0,0 +1,27 @@
1
+ {
2
+ "name": "create-zebrabot",
3
+ "version": "1.0.0",
4
+ "description": "ZebraBot starter kit installer",
5
+ "main": "index.js",
6
+ "directories": {
7
+ "lib": "lib",
8
+ "test": "test"
9
+ },
10
+ "scripts": {
11
+ "test": "echo \"Error: no test specified\" && exit 1"
12
+ },
13
+ "repository": {
14
+ "type": "git",
15
+ "url": "git+https://bitbucket.org/zebra-it/zebrabot.git"
16
+ },
17
+ "bin": {
18
+ "create-zebrabot": "index.js"
19
+ },
20
+ "dependencies": {
21
+ "degit": "^2.8.4"
22
+ },
23
+ "keywords": [],
24
+ "author": "",
25
+ "license": "ISC",
26
+ "homepage": "https://bitbucket.org/zebra-it/zebrabot#readme"
27
+ }