@kengic/uni 0.7.8 → 0.7.10

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 -2
  2. package/script/cmd.mjs +11 -3
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kengic/uni",
3
- "version": "0.7.8",
3
+ "version": "0.7.10",
4
4
  "scripts": {
5
5
  "postinstall": "node ./script/postinstall.mjs"
6
6
  },
@@ -22,7 +22,6 @@
22
22
  "@types/lodash-es": "4.17.12",
23
23
  "@types/node": "18.16.3",
24
24
  "@types/semver": "7.3.13",
25
- "@types/uuid": "11.0.0",
26
25
  "@vitejs/plugin-vue": "4.2.1",
27
26
  "@vueuse/core": "8.9.4",
28
27
  "@vueuse/shared": "8.9.4",
package/script/cmd.mjs CHANGED
@@ -24,17 +24,25 @@ async function cmd() {
24
24
  log(`当前目录 | ${process.cwd()}`);
25
25
 
26
26
  if (!args.appid) {
27
- log(`参数 appid 不能为空`);
27
+ log(`参数不能为空 | appid`);
28
28
  return;
29
29
  }
30
30
 
31
+ const sourceDir = process.cwd() + '/dist/build/app';
31
32
  const targetDir = process.cwd() + '/android/app/src/main/assets/apps/__UNI__8B6E231/www';
33
+
34
+ if (!fs.existsSync(sourceDir)) {
35
+ log(`起始目录尚不存在 | ${sourceDir}`);
36
+ return;
37
+ }
38
+
32
39
  log(`开始删除旧的目录 | ${targetDir}`);
33
40
  fs.rmSync(targetDir, { force: true, recursive: true });
34
41
  log(`完成删除旧的目录 | ${targetDir}`);
35
42
 
36
- // TODO LT
37
- log('复制成功');
43
+ log(`开始复制新的文件 | ${sourceDir}`);
44
+ fs.cpSync(sourceDir, targetDir, { recursive: true });
45
+ log(`完成复制新的文件 | ${sourceDir}`);
38
46
  } catch (e) {
39
47
  console.log(e);
40
48
  }