Comparing version 0.0.1-beta.12 to 0.0.1-beta.13
@@ -11,2 +11,3 @@ import fs from 'fs/promises'; | ||
import { dir } from 'tmp-promise'; | ||
import { packageDirectory } from 'pkg-dir'; | ||
@@ -59,10 +60,13 @@ export default class MacBuilder implements IBuilder { | ||
const code = await shellExec('../node_modules/@tauri-apps/cli/tauri.js build --config ${configJsonPath} --target universal-apple-darwin'); | ||
const npmDirectory = await packageDirectory(); | ||
console.log(npmDirectory) | ||
const code = await shellExec(`${path.join(npmDirectory, 'node_modules/@tauri-apps/cli/tauri.js')} build --config ${configJsonPath} --target universal-apple-darwin`); | ||
const dmgName = `${name}_${'0.2.0'}_universal.dmg`; | ||
await fs.copyFile(this.getBuildedAppPath(dmgName), path.resolve(dmgName)); | ||
const appPath = this.getBuildedAppPath(npmDirectory, dmgName); | ||
await fs.copyFile(appPath, path.resolve(dmgName)); | ||
} | ||
getBuildedAppPath(dmgName: string) { | ||
return `../src-tauri/target/universal-apple-darwin/release/bundle/dmg/${dmgName}` | ||
getBuildedAppPath(npmDirectory: string, dmgName: string) { | ||
return path.join(appRootPath.path, 'src-tauri/target/universal-apple-darwin/release/bundle/dmg', dmgName); | ||
} | ||
} |
@@ -17,2 +17,4 @@ import * as Commander from 'commander'; | ||
import shelljs from 'shelljs'; | ||
import appRootPath from 'app-root-path'; | ||
import { packageDirectory } from 'pkg-dir'; | ||
@@ -363,9 +365,12 @@ /****************************************************************************** | ||
yield fs.writeFile(configJsonPath, Buffer.from(JSON.stringify(tauriConf), 'utf-8')); | ||
yield shellExec('../node_modules/@tauri-apps/cli/tauri.js build --config ${configJsonPath} --target universal-apple-darwin'); | ||
const npmDirectory = yield packageDirectory(); | ||
console.log(npmDirectory); | ||
yield shellExec(`${path.join(npmDirectory, 'node_modules/@tauri-apps/cli/tauri.js')} build --config ${configJsonPath} --target universal-apple-darwin`); | ||
const dmgName = `${name}_${'0.2.0'}_universal.dmg`; | ||
yield fs.copyFile(this.getBuildedAppPath(dmgName), path.resolve(dmgName)); | ||
const appPath = this.getBuildedAppPath(npmDirectory, dmgName); | ||
yield fs.copyFile(appPath, path.resolve(dmgName)); | ||
}); | ||
} | ||
getBuildedAppPath(dmgName) { | ||
return `../src-tauri/target/universal-apple-darwin/release/bundle/dmg/${dmgName}`; | ||
getBuildedAppPath(npmDirectory, dmgName) { | ||
return path.join(appRootPath.path, 'src-tauri/target/universal-apple-darwin/release/bundle/dmg', dmgName); | ||
} | ||
@@ -372,0 +377,0 @@ } |
{ | ||
"name": "pake-cli", | ||
"version": "0.0.1-beta.12", | ||
"version": "0.0.1-beta.13", | ||
"description": "用 Rust 来打包你的 App,底层使用 Tauri,当前支持微信读书、Flomo、Vercel", | ||
@@ -37,2 +37,3 @@ "bin": { | ||
"page-icon": "^0.4.0", | ||
"pkg-dir": "^7.0.0", | ||
"png2icons": "^2.0.1", | ||
@@ -39,0 +40,0 @@ "prompts": "^2.4.2", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
6527882
936
14
+ Addedpkg-dir@^7.0.0
+ Addedfind-up@6.3.0(transitive)
+ Addedlocate-path@7.2.0(transitive)
+ Addedp-limit@4.0.0(transitive)
+ Addedp-locate@6.0.0(transitive)
+ Addedpath-exists@5.0.0(transitive)
+ Addedpkg-dir@7.0.0(transitive)
+ Addedyocto-queue@1.1.1(transitive)