hiepdh-playable-toolkit 2.0.1 → 2.0.4

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 +4 -1
  2. package/setup.js +6 -2
package/package.json CHANGED
@@ -1,11 +1,14 @@
1
1
  {
2
2
  "name": "hiepdh-playable-toolkit",
3
- "version": "2.0.1",
3
+ "version": "2.0.4",
4
4
  "main": "setup.js",
5
5
  "dependencies": {
6
6
  "fs-extra": "^11.1.0",
7
7
  "adm-zip": "^0.5.10"
8
8
  },
9
+ "scripts": {
10
+ "postinstall": "node setup.js"
11
+ },
9
12
  "bin": {
10
13
  "hiepdh-setup": "setup.js"
11
14
  },
package/setup.js CHANGED
@@ -1,11 +1,15 @@
1
- const fs = require('fs');
1
+ const fs = require('fs-extra');
2
2
  const path = require('path');
3
3
  const { execSync } = require('child_process');
4
4
 
5
5
  // Xác định thư mục gốc của dự án người dùng
6
- const projectRoot = process.env.INIT_CWD || path.resolve(__dirname, "../../");
6
+ const projectRoot = process.env.INIT_CWD || process.cwd();
7
+ const toolkitRoot = __dirname;
7
8
  const pkgPath = path.join(projectRoot, "package.json");
8
9
 
10
+ console.log("--- Đang cài đặt từ: " + toolkitRoot);
11
+ console.log("--- Đích đến: " + projectRoot);
12
+
9
13
  console.log("--- HiepDH Playable Toolkit: Khởi tạo cấu hình đa phiên bản ---");
10
14
 
11
15
  if (!fs.existsSync(pkgPath)) {