refactor: replace lodash.template with eta
test / test (push) Failing after 3m8s

This commit is contained in:
2026-10-25 14:58:31 +03:00
parent bf9ac8a8bf
commit f45effe571
9 changed files with 789 additions and 808 deletions
+2 -5
View File
@@ -2,9 +2,9 @@ import fs from "fs";
import fse from "fs-extra";
import gulp from "gulp";
import deb from "gulp-debian";
import { template } from "lodash";
import os from "os";
import path from "path";
import template from "../../../../common/template";
import { Config } from "../../../../core/config";
import { Platform } from "../../../../core/type";
import { Packer } from "../../../core/packer";
@@ -20,10 +20,7 @@ export class LinuxDEBPacker extends Packer {
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 desktopTemplate = template(
fs.readFileSync(path.resolve(import.meta.dirname, "..", "template/linux/app.desktop"), "utf8"),
);
const desktop = desktopTemplate(Object.assign({ iconfile: iconfile }, this.config));
const desktop = template.render("linux/app.desktop", Object.assign({ 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}/`);