@cyklang/cli 0.2.0 → 0.2.1

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.
@@ -201,3 +201,25 @@ class ModuleList extends Cmd_1.Cmd {
201
201
  }
202
202
  }
203
203
  }
204
+ class ModuleDelete extends Cmd_1.Cmd {
205
+ constructor(name, description) {
206
+ super(name);
207
+ this.description(description)
208
+ .argument('[files...]', 'module(s) to delete from the database')
209
+ .action(async (files, options) => {
210
+ await this.commandDelete(files, options);
211
+ });
212
+ }
213
+ async commandDelete(files, options) {
214
+ try {
215
+ await this.prologue(options);
216
+ if (this.dbManager === undefined)
217
+ throw 'dbManager undefined';
218
+ if (files.length === 0)
219
+ throw 'no module to delete';
220
+ }
221
+ catch (err) {
222
+ logger.error(err);
223
+ }
224
+ }
225
+ }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cyklang/cli",
3
- "version": "0.2.0",
3
+ "version": "0.2.1",
4
4
  "description": "cyklang CLI",
5
5
  "main": "build/index.js",
6
6
  "scripts": {
@@ -17,7 +17,7 @@
17
17
  "author": "",
18
18
  "license": "ISC",
19
19
  "dependencies": {
20
- "@cyklang/core": "^0.3.4",
20
+ "@cyklang/core": "^0.3.6",
21
21
  "commander": "^9.4.0",
22
22
  "dotenv": "^16.0.1",
23
23
  "form-data": "^4.0.0",
@@ -193,3 +193,27 @@ class ModuleList extends Cmd {
193
193
  }
194
194
  }
195
195
 
196
+ class ModuleDelete extends Cmd {
197
+ constructor(name: string, description: string) {
198
+ super(name)
199
+ this.description(description)
200
+ .argument('[files...]', 'module(s) to delete from the database')
201
+ .action(async(files: any, options: any) => {
202
+ await this.commandDelete(files, options)
203
+ })
204
+ }
205
+ async commandDelete(files: string[], options: any) {
206
+ try {
207
+ await this.prologue(options)
208
+ if (this.dbManager === undefined) throw 'dbManager undefined'
209
+
210
+ if (files.length === 0) throw 'no module to delete'
211
+
212
+
213
+ }
214
+ catch (err){
215
+ logger.error(err)
216
+ }
217
+ }
218
+ }
219
+