pake-cli 0.0.1-beta.14 → 0.0.1-beta.16

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.
@@ -53,12 +53,11 @@ export default class MacBuilder implements IBuilder {
53
53
  tauriConf.tauri.bundle.identifier = identifier;
54
54
  tauriConf.tauri.bundle.icon = [options.icon];
55
55
 
56
- const { path: dirPath } = await dir();
57
- const configJsonPath = `${dirPath}/config.json`;
56
+ const npmDirectory = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
57
+ const configJsonPath = path.join(npmDirectory, 'src-tauri/tauri.conf.json');
58
58
  await fs.writeFile(configJsonPath, Buffer.from(JSON.stringify(tauriConf), 'utf-8'));
59
59
 
60
- const npmDirectory = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
61
- const code = await shellExec(`${path.join(npmDirectory, 'node_modules/@tauri-apps/cli/tauri.js')} build --config ${configJsonPath} --target universal-apple-darwin`);
60
+ const code = await shellExec(`cd ${npmDirectory} && npm run build`);
62
61
  const dmgName = `${name}_${'0.2.0'}_universal.dmg`;
63
62
  const appPath = this.getBuildedAppPath(npmDirectory, dmgName);
64
63
  await fs.copyFile(appPath, path.resolve(dmgName));
package/dist/cli.js CHANGED
@@ -356,11 +356,10 @@ class MacBuilder {
356
356
  tauriConf.package.productName = name;
357
357
  tauriConf.tauri.bundle.identifier = identifier;
358
358
  tauriConf.tauri.bundle.icon = [options.icon];
359
- const { path: dirPath } = yield dir();
360
- const configJsonPath = `${dirPath}/config.json`;
361
- yield fs.writeFile(configJsonPath, Buffer.from(JSON.stringify(tauriConf), 'utf-8'));
362
359
  const npmDirectory = path.join(path.dirname(fileURLToPath(import.meta.url)), '..');
363
- yield shellExec(`${path.join(npmDirectory, 'node_modules/@tauri-apps/cli/tauri.js')} build --config ${configJsonPath} --target universal-apple-darwin`);
360
+ const configJsonPath = path.join(npmDirectory, 'src-tauri/tauri.conf.json');
361
+ yield fs.writeFile(configJsonPath, Buffer.from(JSON.stringify(tauriConf), 'utf-8'));
362
+ yield shellExec(`cd ${npmDirectory} && npm run build`);
364
363
  const dmgName = `${name}_${'0.2.0'}_universal.dmg`;
365
364
  const appPath = this.getBuildedAppPath(npmDirectory, dmgName);
366
365
  yield fs.copyFile(appPath, path.resolve(dmgName));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "pake-cli",
3
- "version": "0.0.1-beta.14",
3
+ "version": "0.0.1-beta.16",
4
4
  "description": "用 Rust 来打包你的 App,底层使用 Tauri,当前支持微信读书、Flomo、Vercel",
5
5
  "bin": {
6
6
  "pake": "./cli.js"