✨ 2.0 Upgrade Plan
This commit is contained in:
13
bin/helpers/merge.ts
vendored
13
bin/helpers/merge.ts
vendored
@@ -14,6 +14,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon
|
||||
fullscreen,
|
||||
hideTitleBar,
|
||||
alwaysOnTop,
|
||||
darkMode,
|
||||
disabledWebShortcuts,
|
||||
activationShortcut,
|
||||
userAgent,
|
||||
@@ -25,6 +26,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon
|
||||
resizable = true,
|
||||
inject,
|
||||
proxyUrl,
|
||||
installerLanguage,
|
||||
} = options;
|
||||
|
||||
const { platform } = process;
|
||||
@@ -38,12 +40,16 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon
|
||||
hide_title_bar: hideTitleBar,
|
||||
activation_shortcut: activationShortcut,
|
||||
always_on_top: alwaysOnTop,
|
||||
dark_mode: darkMode,
|
||||
disabled_web_shortcuts: disabledWebShortcuts,
|
||||
};
|
||||
Object.assign(tauriConf.pake.windows[0], { url, ...tauriConfWindowOptions });
|
||||
|
||||
tauriConf.productName = name;
|
||||
tauriConf.identifier = identifier;
|
||||
tauriConf.package.productName = name;
|
||||
tauriConf.tauri.bundle.identifier = identifier;
|
||||
if (platform == "win32") {
|
||||
tauriConf.tauri.bundle.windows.wix.language[0] = installerLanguage;
|
||||
}
|
||||
|
||||
//Judge the type of URL, whether it is a file or a website.
|
||||
const pathExists = await fsExtra.pathExists(url);
|
||||
@@ -189,9 +195,7 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon
|
||||
tauriConf.pake.inject = [];
|
||||
await fsExtra.writeFile(injectFilePath, '');
|
||||
}
|
||||
|
||||
tauriConf.pake.proxy_url = proxyUrl || "";
|
||||
|
||||
// Save config file.
|
||||
const platformConfigPaths: PlatformMap = {
|
||||
win32: 'tauri.windows.conf.json',
|
||||
@@ -212,7 +216,6 @@ export async function mergeConfig(url: string, options: PakeAppOptions, tauriCon
|
||||
if (process.env.NODE_ENV === 'development') {
|
||||
tauriConf2.bundle = bundleConf.bundle;
|
||||
}
|
||||
console.log('tauriConf', tauriConf2)
|
||||
const configJsonPath = path.join(tauriConfigDirectory, 'tauri.conf.json');
|
||||
await fsExtra.outputJSON(configJsonPath, tauriConf2, { spaces: 4 });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user