sys-shim 0.0.1-20 → 0.0.1-22

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/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "sys-shim",
3
3
  "private": false,
4
4
  "type": "module",
5
- "version": "0.0.1-20",
5
+ "version": "0.0.1-22",
6
6
  "main": "./script/npm-pkg/node/main.min.cjs",
7
7
  "module": "./script/npm-pkg/node/main.min.mjs",
8
8
  "browser": {
@@ -87,7 +87,7 @@
87
87
  "minimist": "^1.2.8",
88
88
  "shelljs": "^0.8.5",
89
89
  "shx": "^0.3.4",
90
- "sys-shim-bin": "0.0.2-2"
90
+ "sys-shim-bin": "0.0.2-3"
91
91
  },
92
92
  "scripts": {
93
93
  "release": "release-it prerelease -V --ci",
package/readme.md CHANGED
@@ -9,7 +9,7 @@ npm run sys-shim
9
9
  :: 启动前端
10
10
  npx vite
11
11
 
12
- :: debug sdk
12
+ :: 调试 cli
13
13
  npm run sys-shim pack -- --input https://example.com/
14
14
  ```
15
15
 
@@ -40,6 +40,7 @@ async function parseArgv(argv) {
40
40
  const cfg = {
41
41
  nameSuffix: true,
42
42
  input: ``,
43
+ binPath: ``,
43
44
  icon: ``,
44
45
  out: ``,
45
46
  unzip: ``,
@@ -161,7 +162,7 @@ function genFile(cfg) {
161
162
  shelljs.rm(`-fr`, newCfg.input)
162
163
  shelljs.mkdir(`-p`, newCfg.input)
163
164
  shelljs.cp(`-fr`, `${pkgDir}/template/pack/*`, newCfg.input)
164
- shelljs.cp(`-f`, binPath, newCfg.input)
165
+ shelljs.cp(`-f`, cfg.binPath || binPath, newCfg.input)
165
166
  shelljs.cp(`-f`, `${pkgDir}/script/npm-pkg/shim/win/favicon.ico`, newCfg.input)
166
167
  shelljs.cp(`-f`, cfg.icon, `${newCfg.input}/favicon.ico`)
167
168
  determinePathType(cfg.input) !== `url` && fs.statSync(cfg.input).isDirectory() && shelljs.cp(`-fr`, `${cfg.input}/*`, newCfg.input)
@@ -173,7 +174,7 @@ function genFile(cfg) {
173
174
  fs.writeFileSync(`${newCfg.input}/package.json`, newStr)
174
175
  runConfig = JSON.parse(newStr)
175
176
  } else {
176
- runConfig = require(`${cfg.input}/package.json`)
177
+ runConfig = JSON.parse(fs.readFileSync(`${cfg.input}/package.json`, `utf8`))
177
178
  }
178
179
  console.log(`Runtime configuration:`, runConfig)
179
180
  return newCfg