@eziapp-org/builder 0.0.0-beta.7 → 0.0.0-beta.8
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.
|
Binary file
|
|
Binary file
|
|
@@ -50,14 +50,24 @@ class windowsPackager {
|
|
|
50
50
|
this.tempDir = tempDir;
|
|
51
51
|
}
|
|
52
52
|
async package() {
|
|
53
|
-
console.log("packaging for
|
|
53
|
+
console.log(chalk_1.default.green("✓ packaging for windows..."));
|
|
54
54
|
const appName = this.eziConfig?.application?.name || "EziApp";
|
|
55
55
|
// 复制到输出目录
|
|
56
56
|
const outAppPath = path.join(this.outDir, `${appName}_winx64.exe`);
|
|
57
57
|
if (!fs.existsSync(this.outDir)) {
|
|
58
58
|
fs.mkdirSync(this.outDir, { recursive: true });
|
|
59
59
|
}
|
|
60
|
-
|
|
60
|
+
try {
|
|
61
|
+
fs.copyFileSync(this.eziappBinPath, outAppPath);
|
|
62
|
+
}
|
|
63
|
+
catch (error) {
|
|
64
|
+
// 如果是因为占用导致的失败,提示用户关闭正在运行的应用
|
|
65
|
+
if (error.code === 'EBUSY') {
|
|
66
|
+
console.error(chalk_1.default.red(`✗ 应用 ${appName} 正忙碌中,请关闭正在运行的应用 ${appName} 后重试。`));
|
|
67
|
+
process.exit(1);
|
|
68
|
+
}
|
|
69
|
+
throw error;
|
|
70
|
+
}
|
|
61
71
|
// 输入程序参数
|
|
62
72
|
this.argv.push(...['--input', outAppPath]);
|
|
63
73
|
// 打包ezi资源参数
|
|
@@ -86,7 +96,7 @@ class windowsPackager {
|
|
|
86
96
|
// 开始打包
|
|
87
97
|
const packagerCmd = `"${this.packagerBinPath}" --update-version true ${this.argv.join(' ')}`;
|
|
88
98
|
(0, child_process_1.execSync)(packagerCmd, { stdio: 'inherit' });
|
|
89
|
-
console.log(chalk_1.default.green("✓
|
|
99
|
+
console.log(chalk_1.default.green("✓ packaging completed:\n" + outAppPath));
|
|
90
100
|
}
|
|
91
101
|
catch (error) {
|
|
92
102
|
console.error(error);
|
package/dist/src/builder.js
CHANGED
|
@@ -61,7 +61,7 @@ class Builder {
|
|
|
61
61
|
package: "com.ezi.app",
|
|
62
62
|
},
|
|
63
63
|
window: {
|
|
64
|
-
title: "
|
|
64
|
+
title: "EziApplication"
|
|
65
65
|
}
|
|
66
66
|
};
|
|
67
67
|
this.mode = config.mode || (0, utils_1.getArg)("--mode") || 'debug';
|
|
@@ -112,7 +112,7 @@ class Builder {
|
|
|
112
112
|
offset += configSize;
|
|
113
113
|
// 打包资源文件
|
|
114
114
|
const assetsDir = path.join(process.cwd(), this.eziConfig.application.buildEntry || "dist");
|
|
115
|
-
console.log(
|
|
115
|
+
console.log(green(`✓ frontend assets located at: ${this.eziConfig.application.buildEntry}`));
|
|
116
116
|
const files = (0, utils_1.getAllFiles)(assetsDir);
|
|
117
117
|
for (const file of files) {
|
|
118
118
|
const filePath = path.join(assetsDir, file);
|