@kengic/uni 0.7.5 → 0.7.7

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/package.json +1 -1
  2. package/script/cmd.mjs +12 -2
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/uni",
3
- "version": "0.7.5",
3
+ "version": "0.7.7",
4
4
  "scripts": {
5
5
  "postinstall": "node ./script/postinstall.mjs"
6
6
  },
package/script/cmd.mjs CHANGED
@@ -1,4 +1,5 @@
1
1
  import { Command } from 'commander';
2
+ import fs from 'fs';
2
3
 
3
4
  const program = new Command();
4
5
 
@@ -19,9 +20,18 @@ async function cmd() {
19
20
  .option('--appid <appid>', 'APPID', '')
20
21
  .action(async (args) => {
21
22
  try {
22
- log(``);
23
+ log(`命令参数 | ${JSON.stringify(args)}`);
23
24
  log(`当前目录 | ${process.cwd()}`);
24
- log(`args | ${args}`);
25
+
26
+ if (!args.appid) {
27
+ log(`参数 appid 不能为空`);
28
+ return;
29
+ }
30
+
31
+ const targetDir = process.cwd() + '/android/app/src/main/assets/apps/__UNI__8B6E231/www';
32
+ log(`开始删除旧的目录 | ${targetDir}`);
33
+ fs.rmSync(targetDir);
34
+ log(`完成删除旧的目录 | ${targetDir}`);
25
35
 
26
36
  // TODO LT
27
37
  log('复制成功');