[deb] copy app icon

This commit is contained in:
2019-03-14 21:15:43 +03:00
parent 0ee8ed8cd8
commit 34d7baf15f
3 changed files with 6 additions and 4 deletions

View File

@@ -184,11 +184,13 @@ 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 desktopTemplate = template(fs.readFileSync(path.resolve(__dirname, '..', 'template/linux/app.desktop')));
const desktop = desktopTemplate(this.config);
const desktop = desktopTemplate(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}/`);
fse.copySync(this.config.meta.icon, `${buildDir}/usr/share/${this.config.meta.filename}/${iconfile}`);
return gulp.src(`${buildDir}/*`)
.pipe(deb({
package: this.config.meta.filename,

View File

@@ -1,6 +1,6 @@
{
"name": "gulp-haxetool",
"version": "0.0.14",
"version": "0.0.15",
"description": "HaXe Tool for Gulp",
"main": "index.js",
"dependencies": {

View File

@@ -3,7 +3,7 @@ Encoding=UTF-8
Type=Application
Comment=<%=meta.title%> <%=meta.version%>
Exec=bash -c 'cd "/usr/share/<%=meta.filename%>" && ./<%=meta.filename%>'
Icon=/usr/share/<%=meta.filename%>/<%=meta.icon%>
Icon=/usr/share/<%=meta.filename%>/<%=iconfile%>
Name=<%=meta.title%>
Categories=Game
Terminal=false