Skip to content

Commit

Permalink
v0.0.14
Browse files Browse the repository at this point in the history
  • Loading branch information
iamEvanYT committed Dec 3, 2024
1 parent ae52c4a commit e109aa2
Show file tree
Hide file tree
Showing 10 changed files with 70 additions and 17 deletions.
22 changes: 16 additions & 6 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,8 @@ jobs:
if: matrix.os == 'ubuntu-latest'
run: |
mkdir -p distributables/deb distributables/rpm
cp ./backend/out/make/deb/**/*.deb distributables/deb/
cp ./backend/out/make/rpm/**/*.rpm distributables/rpm/
cp ./backend/out/make/deb/**/*.deb distributables/deb/quick-finder-amd64.deb
cp ./backend/out/make/rpm/**/*.rpm distributables/rpm/quick-finder-x86_64.rpm
cd distributables
zip -r quickfinder-linux.zip *
cd ..
Expand Down Expand Up @@ -95,15 +95,25 @@ jobs:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Upload Release Asset (Ubuntu)
- name: Upload Release Asset (Ubuntu - deb)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./artifacts/build-ubuntu-latest/quickfinder-linux.zip
asset_name: quickfinder-linux.zip
asset_content_type: application/zip
asset_path: ./artifacts/build-ubuntu-latest/deb/quick-finder-amd64.deb
asset_name: quick-finder-amd64.deb
asset_content_type: application/vnd.debian.binary-package

- name: Upload Release Asset (Ubuntu - rpm)
uses: actions/upload-release-asset@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
upload_url: ${{ steps.get_release.outputs.upload_url }}
asset_path: ./artifacts/build-ubuntu-latest/rpm/quick-finder-x86_64.rpm
asset_name: quick-finder-x86_64.rpm
asset_content_type: application/x-rpm

- name: Upload Release Asset (macOS)
uses: actions/upload-release-asset@v1
Expand Down
39 changes: 35 additions & 4 deletions backend/forge.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,22 +11,51 @@ import { FuseV1Options, FuseVersion } from "@electron/fuses";
import { mainConfig } from "./webpack.main.config";
import { rendererConfig } from "./webpack.renderer.config";

import fs from "fs";
import fs, { existsSync, readFileSync } from "fs";
import path from "path";
import { execSync } from "child_process";

let appVersion = "dev";
let buildVersion = "dev";

const DEV_REGENERATE_FRONTEND = true;
let REGENERATE_FRONTEND = DEV_REGENERATE_FRONTEND;
if (process.env.BUILD_ENV == "production") {
REGENERATE_FRONTEND = true;

try {
const packageContent = readFileSync("../package.json", "utf8");
const packageJSON = JSON.parse(packageContent);
if (packageJSON.version) {
appVersion = packageJSON.version;
}
} catch {
/* empty */
}

try {
const gitDir = path.resolve(__dirname, "../.git");
if (existsSync(gitDir)) {
buildVersion = execSync("git rev-parse --short HEAD", { cwd: path.dirname(gitDir) })
.toString()
.trim();
}
} catch {
/* empty */
}
}

console.log("App Version:", appVersion);
console.log("Build Version", buildVersion);

const config: ForgeConfig = {
packagerConfig: {
executableName: "quick-finder",
asar: true,
icon: "icons/macos/AppIcon.icns",
appBundleId: "dev.iamevan.quickfinder"
appBundleId: "dev.iamevan.quickfinder",
appVersion,
buildVersion
},
rebuildConfig: {},
makers: [
Expand All @@ -40,13 +69,15 @@ const config: ForgeConfig = {
new MakerRpm({
options: {
name: "quick-finder",
genericName: "QuickFinder"
genericName: "QuickFinder",
icon: "./icons/web/icon-512.png"
}
}),
new MakerDeb({
options: {
name: "quick-finder",
genericName: "QuickFinder"
genericName: "QuickFinder",
icon: "./icons/web/icon-512.png"
}
})
],
Expand Down
2 changes: 1 addition & 1 deletion backend/package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "quick-finder",
"productName": "QuickFinder",
"version": "0.0.13",
"version": "0.1.0",
"description": "Quickly search files, applications, and run commands!",
"main": ".webpack/main",
"scripts": {
Expand Down
Binary file added backend/src/assets/icon-rounded.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
11 changes: 8 additions & 3 deletions backend/src/ipc/apps/linux.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import fs from "fs/promises";
import fs from "fs";
import fsPromises from "fs/promises";
import path from "path";
import { exec } from "child_process";
import util from "util";
Expand All @@ -8,7 +9,7 @@ const execAsync = util.promisify(exec);

async function parseDesktopFile(filePath: string): Promise<{ name: string; icon: string; path: string } | null> {
try {
const content = await fs.readFile(filePath, "utf-8");
const content = await fsPromises.readFile(filePath, "utf-8");
const lines = content.split("\n");
let name = "";
let icon = "";
Expand Down Expand Up @@ -47,8 +48,12 @@ async function getIconPath(iconName: string): Promise<string> {
async function getLinuxApplicationsInDirectory(dir: string): Promise<{ name: string; icon: string; path: string }[]> {
const apps: { name: string; icon: string; path: string }[] = [];

if (!fs.existsSync(dir)) {
return [];
}

try {
const files = await fs.readdir(dir);
const files = await fsPromises.readdir(dir);
for (const file of files) {
if (file.endsWith(".desktop")) {
const filePath = path.join(dir, file);
Expand Down
8 changes: 7 additions & 1 deletion backend/src/modules/windows-manager.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
// Manage windows orchastration (is that the right word?)

import { app, BrowserWindow } from "electron";
import { app, BrowserWindow, nativeImage } from "electron";
import path from "path";

export type WindowType = {
window: BrowserWindow;
Expand Down Expand Up @@ -40,6 +41,11 @@ export function registerWindow(windowId: string, windowData: WindowType): boolea
console.warn(`Window with ID ${windowId} already exists.`);
return false;
}

if (process.platform == "linux" && windowData.window) {
windowData.window.setIcon(nativeImage.createFromPath(path.join(__dirname, "assets", "icon-rounded.png")));
}

windowsManager.set(windowId, {
...windowData,
show: () => {
Expand Down
1 change: 1 addition & 0 deletions backend/src/windows/spotter/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ export const createSpotterWindow = (): void => {
devTools: devMode
},
movable: true,
transparent: true,
frame: false,
resizable: false,
show: false,
Expand Down
2 changes: 1 addition & 1 deletion frontend/extensions/applications/commands.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ export function useApplicationCommands() {
...extensionInfo,

icon: app.icon || "FileQuestion",
id: app.name,
id: app.path,
title: app.name,
filePath: app.path,
type: "Application",
Expand Down
1 change: 0 additions & 1 deletion frontend/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
{
"name": "quick-finder",
"version": "0.1.0",
"private": true,
"scripts": {
"dev": "next dev --turbopack",
Expand Down
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
{
"version": "0.0.14",
"scripts": {
"start": "cd backend && npm run start",
"code": "code ./frontend && code ./backend",
Expand Down

0 comments on commit e109aa2

Please sign in to comment.