🎨 Fix the packaging issue for Linux and Windows
This commit is contained in:
28
bin/builders/LinuxBuilder.ts
vendored
28
bin/builders/LinuxBuilder.ts
vendored
@@ -3,29 +3,31 @@ import { PakeAppOptions } from '@/types';
|
||||
import tauriConfig from '@/helpers/tauriConfig';
|
||||
|
||||
export default class LinuxBuilder extends BaseBuilder {
|
||||
|
||||
constructor(options: PakeAppOptions) {
|
||||
super(options);
|
||||
}
|
||||
|
||||
getFileName(): string {
|
||||
const { name } = this.options;
|
||||
const arch = process.arch === "x64" ? "amd64" : process.arch;
|
||||
return `${name}_${tauriConfig.package.version}_${arch}`;
|
||||
}
|
||||
|
||||
// Customize it, considering that there are all targets.
|
||||
async build(url: string) {
|
||||
const targetTypes = ['deb', 'appimage'];
|
||||
for (const type of targetTypes) {
|
||||
if (this.options.targets === type || this.options.targets === "all") {
|
||||
await this.buildAndCopy(url);
|
||||
const targetTypes = ["deb", "appimage"];
|
||||
for (const target of targetTypes) {
|
||||
if (this.options.targets === target || this.options.targets === "all") {
|
||||
await this.buildAndCopy(url, target);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
getFileName(): string {
|
||||
const { name } = this.options;
|
||||
const arch = this.getArch();
|
||||
return `${name}_${tauriConfig.package.version}_${arch}`;
|
||||
}
|
||||
|
||||
getExtension(): string {
|
||||
if (this.options.targets === 'appimage') {
|
||||
protected getFileType(target: string): string {
|
||||
if (target === 'appimage') {
|
||||
return 'AppImage';
|
||||
}
|
||||
return this.options.targets;
|
||||
return super.getFileType(target);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user