refactor(preset): rework preset
test / test (push) Failing after 5m32s

This commit is contained in:
2026-10-29 20:35:53 +03:00
parent d9e8976e85
commit 2605c1bbc8
41 changed files with 475 additions and 473 deletions
+6 -4
View File
@@ -4,13 +4,14 @@ import gulp from "gulp";
import deb from "gulp-debian";
import os from "os";
import path from "path";
import asset from "../../../../common/asset";
import template from "../../../../common/template";
import { Config } from "../../../../core/config";
import { Platform } from "../../../../core/type";
import { type Config, Platform } from "../../../../core/type";
import { Packer } from "../../../core/packer";
export class LinuxDEBPacker extends Packer {
static NAME = "deb";
static DEFAULT_ICON = asset("icon.jpg");
constructor(config: Config) {
super(config, Platform.LINUX);
@@ -19,12 +20,13 @@ export class LinuxDEBPacker extends Packer {
call() {
const target = this.targetPath;
const buildDir = path.join(os.tmpdir(), "build", this.config.name, "debian");
const iconfile = `${this.config.meta.filename}${path.extname(this.config.meta.icon!)}`;
const icon = this.config.meta.icon || LinuxDEBPacker.DEFAULT_ICON;
const iconfile = `${this.config.meta.filename}${path.extname(icon)}`;
const desktop = template.render("linux/app.desktop", { iconfile: iconfile, ...this.config });
fse.ensureDirSync(`${buildDir}/usr/share/applications`);
fs.writeFileSync(`${buildDir}/usr/share/applications/${this.config.meta.filename}.desktop`, desktop);
fse.copySync(`${target}`, `${buildDir}/usr/share/${this.config.meta.filename}/`);
fse.copySync(this.config.meta.icon!, `${buildDir}/usr/share/${this.config.meta.filename}/${iconfile}`);
fse.copySync(icon, `${buildDir}/usr/share/${this.config.meta.filename}/${iconfile}`);
return gulp.src(`${buildDir}/*`).pipe(
deb({
package: this.config.meta.filename!,