java-project-starter 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.
- package/index.js +23 -0
- package/package.json +22 -0
- package/template.zip +0 -0
package/index.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const path = require("path");
|
|
4
|
+
const fs = require("fs");
|
|
5
|
+
const AdmZip = require("adm-zip");
|
|
6
|
+
|
|
7
|
+
const zipPath = path.join(__dirname, "template.zip");
|
|
8
|
+
const outputPath = process.cwd(); // Extract where user runs command
|
|
9
|
+
|
|
10
|
+
console.log("Setting up Java project...");
|
|
11
|
+
|
|
12
|
+
if (!fs.existsSync(zipPath)) {
|
|
13
|
+
console.error("Template zip not found!");
|
|
14
|
+
process.exit(1);
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
try {
|
|
18
|
+
const zip = new AdmZip(zipPath);
|
|
19
|
+
zip.extractAllTo(outputPath, true);
|
|
20
|
+
console.log("Java project setup complete!");
|
|
21
|
+
} catch (err) {
|
|
22
|
+
console.error("Error extracting project:", err);
|
|
23
|
+
}
|
package/package.json
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "java-project-starter",
|
|
3
|
+
"version": "1.0.0",
|
|
4
|
+
"description": "CLI tool to setup Java project",
|
|
5
|
+
"bin": {
|
|
6
|
+
"java-setup": "./index.js"
|
|
7
|
+
},
|
|
8
|
+
"files": [
|
|
9
|
+
"template.zip",
|
|
10
|
+
"index.js"
|
|
11
|
+
],
|
|
12
|
+
"keywords": [
|
|
13
|
+
"java",
|
|
14
|
+
"starter",
|
|
15
|
+
"cli"
|
|
16
|
+
],
|
|
17
|
+
"author": "Your Name",
|
|
18
|
+
"license": "MIT",
|
|
19
|
+
"dependencies": {
|
|
20
|
+
"adm-zip": "^0.5.10"
|
|
21
|
+
}
|
|
22
|
+
}
|
package/template.zip
ADDED
|
Binary file
|