Skip to content

Commit e6c6003

Browse files
committed
feat: new icon for the Electron template built in the CI
1 parent 4a180f8 commit e6c6003

File tree

4 files changed

+11
-0
lines changed

4 files changed

+11
-0
lines changed

.github/workflows/build.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -589,6 +589,8 @@ jobs:
589589

590590
steps:
591591
- uses: actions/checkout@v4
592+
with:
593+
lfs: true
592594
- uses: actions/setup-node@v4
593595
with:
594596
node-version: "20"

assets/electronTemplate.icon.png

764 KB
Loading

scripts/scaffoldElectronExampleForCiBuild.ts

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import path from "path";
2+
import {fileURLToPath} from "url";
23
import yargs from "yargs";
34
import {hideBin} from "yargs/helpers";
45
import fs from "fs-extra";
@@ -7,6 +8,8 @@ import {packedProjectTemplatesDirectory} from "../src/config.js";
78

89
import "./packTemplates.js";
910

11+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
12+
1013
const electronTemplateName = "electron-typescript-react";
1114
const projectName = "node-llama-cpp-electron-example";
1215

@@ -54,4 +57,9 @@ delete packageJson.scripts["models:pull"];
5457

5558
await fs.writeJson(packageJsonPath, packageJson, {spaces: 2});
5659

60+
const sourceAppIconPath = path.join(__dirname, "..", "assets", "electronTemplate.icon.png");
61+
const appIconPath = path.join(resolvedPackageFolderPath, "public", "app-icon.png");
62+
63+
await fs.copyFile(sourceAppIconPath, appIconPath);
64+
5765
console.info(`Scaffolded ${projectName} in ${resolvedPackageFolderPath} with package version ${packageVersion}`);

templates/electron-typescript-react/electron-builder.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ export default {
1818
directories: {
1919
output: "release"
2020
},
21+
icon: "./public/app-icon.png",
2122

2223
// remove this once you set up your own code signing for macOS
2324
async afterPack(context) {

0 commit comments

Comments
 (0)