From 53131854070a103752491a69ecf1db842ecf12fe Mon Sep 17 00:00:00 2001 From: avocadianmage Date: Sat, 8 Sep 2018 04:51:44 -0500 Subject: [PATCH] fix tab icon loading --- package-lock.json | 8 ++++---- package.json | 4 ++-- src/ts/TabManager.ts | 13 ++++++++----- 3 files changed, 14 insertions(+), 11 deletions(-) diff --git a/package-lock.json b/package-lock.json index 3d1b6b3..33a3a09 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "boysen", - "version": "1.0.0", + "version": "1.0.2", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -1033,9 +1033,9 @@ } }, "file-icon-info": { - "version": "1.0.14", - "resolved": "https://registry.npmjs.org/file-icon-info/-/file-icon-info-1.0.14.tgz", - "integrity": "sha512-xr8twXF9ZXUWN9hRlAkTNKugZe8NqlGjQI3L/YAKXwwOCQYn7BUKHKjdagXnD4YlpnLPaukyteJfP0WkACD64g==", + "version": "1.0.15", + "resolved": "https://registry.npmjs.org/file-icon-info/-/file-icon-info-1.0.15.tgz", + "integrity": "sha512-MJmMXIrG1SIzr4CGQhGazWzlgDZGsMl3lmTRn0CZ3CInpZGPyNvloV4gQZbIJJPbmaOW2/X3gKf4aIgg9rkImA==", "requires": { "@types/node": "^10.9.4" }, diff --git a/package.json b/package.json index 40f2a85..f3db0b0 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "boysen", - "version": "1.0.1", + "version": "1.0.2", "description": "A modern and lightweight PowerShell emulator", "main": "src/ts-build/main.js", "scripts": { @@ -23,7 +23,7 @@ "ajv": "^6.0.0", "dragula": "^3.7.2", "electron-tabs": "^0.9.4", - "file-icon-info": "^1.0.14", + "file-icon-info": "^1.0.15", "node-pty": "^0.7.6", "xterm": "^3.6.0" }, diff --git a/src/ts/TabManager.ts b/src/ts/TabManager.ts index a073abc..e1ad5db 100644 --- a/src/ts/TabManager.ts +++ b/src/ts/TabManager.ts @@ -157,14 +157,17 @@ export class TabManager { } private setTabIconFromShell(tab: TabGroup.Tab, exeName: string) { - const appDataPath = process.env.APPDATA; - const appName = path.basename(process.argv[1]); - const iconPath - = `${appDataPath}/${appName}/Cache/shell-icons/${exeName}.ico`; + const iconPath = path.join( + process.env.APPDATA!, + 'boysen', + 'Cache', + 'shell-icons', + `${exeName}.ico` + ); // If icon file is already cached, use it. if (fs.existsSync(iconPath)) tab.setIcon(iconPath); - + // Find the full file path of the shell executable and extract its icon. else exec('where ' + exeName, (err, stdout, stderr) => { if (err) console.log(stderr);