webide-cli 0.0.1 → 0.0.2
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 +2 -0
- package/index.js +23 -0
- package/package.json +1 -1
package/README.md
CHANGED
package/index.js
CHANGED
|
@@ -65,6 +65,26 @@ program
|
|
|
65
65
|
console.log("Current working directory:", process.cwd());
|
|
66
66
|
});
|
|
67
67
|
|
|
68
|
+
program
|
|
69
|
+
.command("checkdb")
|
|
70
|
+
.description("Check if Database connection is working.")
|
|
71
|
+
.action(async () => {
|
|
72
|
+
const load = loading("Checking database connection...");
|
|
73
|
+
try {
|
|
74
|
+
const { data, error } = await bucket.exists('.check');
|
|
75
|
+
if (error) {
|
|
76
|
+
load();
|
|
77
|
+
console.error("Database connection failed:", error.message);
|
|
78
|
+
process.exit(114514);
|
|
79
|
+
}
|
|
80
|
+
load();
|
|
81
|
+
console.log("Database connection is working.");
|
|
82
|
+
} catch (error) {
|
|
83
|
+
load();
|
|
84
|
+
console.error("Database connection failed:", error.message);
|
|
85
|
+
}
|
|
86
|
+
})
|
|
87
|
+
|
|
68
88
|
program
|
|
69
89
|
.command('add <name>')
|
|
70
90
|
.description('Add a new library.')
|
|
@@ -182,8 +202,10 @@ program
|
|
|
182
202
|
}
|
|
183
203
|
const load = loading(`Publishing library "${name}" ...`);
|
|
184
204
|
let totalSize = 0;
|
|
205
|
+
let totalFiles = 0;
|
|
185
206
|
await upload(libpath);
|
|
186
207
|
load();
|
|
208
|
+
console.log(`Total files: ${totalFiles}`);
|
|
187
209
|
console.log(`Total size: ${totalSize} bytes`);
|
|
188
210
|
console.log(`Library "${name}" published successfully.`);
|
|
189
211
|
|
|
@@ -198,6 +220,7 @@ program
|
|
|
198
220
|
const fileType = path.extname(filePath).substring(1);
|
|
199
221
|
const fileSize = stats.size;
|
|
200
222
|
totalSize += fileSize;
|
|
223
|
+
totalFiles++;
|
|
201
224
|
const fp = filePath.replace(libpath, name).replace(/\\/g, '/');
|
|
202
225
|
const { data, error } = await bucket.update(fp, fileData, { contentType: fileType });
|
|
203
226
|
if (error) {
|