Skip to content

Commit

Permalink
fixup some bug for MacOS pake-cli
Browse files Browse the repository at this point in the history
  • Loading branch information
Tlntin committed Apr 17, 2023
1 parent ea1d438 commit 3014d60
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 13 deletions.
5 changes: 2 additions & 3 deletions bin/builders/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,6 @@ export async function mergeTauriConfig(
}

// 处理user-agent
logger.warn(userAgent);
if (userAgent.length > 0) {
if (process.platform === "win32") {
tauriConf.pake.user_agent.windows = userAgent;
Expand All @@ -129,7 +128,7 @@ export async function mergeTauriConfig(
}

if (process.platform === "darwin") {
tauriConf.pake.user_agent.macos = true;
tauriConf.pake.menu.macos = true;
}
} else {
if (process.platform === "win32") {
Expand All @@ -141,7 +140,7 @@ export async function mergeTauriConfig(
}

if (process.platform === "darwin") {
tauriConf.pake.user_agent.macos = false;
tauriConf.pake.menu.macos = false;
}
}

Expand Down
19 changes: 9 additions & 10 deletions dist/cli.js
Original file line number Diff line number Diff line change
Expand Up @@ -1706,7 +1706,6 @@ function mergeTauriConfig(url, options, tauriConf) {
tauriConf.pake.windows[0].url_type = "web";
}
// 处理user-agent
logger.warn(userAgent);
if (userAgent.length > 0) {
if (process.platform === "win32") {
tauriConf.pake.user_agent.windows = userAgent;
Expand All @@ -1727,7 +1726,7 @@ function mergeTauriConfig(url, options, tauriConf) {
tauriConf.pake.menu.linux = true;
}
if (process.platform === "darwin") {
tauriConf.pake.user_agent.macos = true;
tauriConf.pake.menu.macos = true;
}
}
else {
Expand All @@ -1738,7 +1737,7 @@ function mergeTauriConfig(url, options, tauriConf) {
tauriConf.pake.menu.linux = false;
}
if (process.platform === "darwin") {
tauriConf.pake.user_agent.macos = false;
tauriConf.pake.menu.macos = false;
}
}
// 处理托盘
Expand Down Expand Up @@ -2091,7 +2090,7 @@ var tauri$3 = {
active: false
},
systemTray: {
iconPath: "png/weread_512.png",
iconPath: "png/icon_512.png",
iconAsTemplate: true
},
allowlist: {
Expand All @@ -2107,7 +2106,7 @@ var build = {
};
var CommonConf = {
"package": {
productName: "WeRead",
productName: "baidu",
version: "1.0.0"
},
tauri: tauri$3,
Expand All @@ -2116,8 +2115,8 @@ var CommonConf = {

var windows = [
{
url: "https://weread.qq.com/",
transparent: true,
url: "https://www.baidu.com",
transparent: false,
fullscreen: false,
width: 1200,
height: 780,
Expand All @@ -2131,7 +2130,7 @@ var user_agent = {
windows: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/108.0.0.0 Safari/537.36"
};
var menu = {
macos: true,
macos: false,
linux: false,
windows: false
};
Expand Down Expand Up @@ -2187,9 +2186,9 @@ var WinConf = {
var tauri$1 = {
bundle: {
icon: [
"icons/weread.icns"
"/Users/hfy/Documents/electron_s/Pake/src-tauri/icons/icon.icns"
],
identifier: "com.tw93.weread",
identifier: "pake-f9751d",
active: true,
category: "DeveloperTool",
copyright: "",
Expand Down

0 comments on commit 3014d60

Please sign in to comment.