New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

hyper-folder-icon

Package Overview
Dependencies
Maintainers
1
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

hyper-folder-icon - npm Package Compare versions

Comparing version 1.1.1 to 1.2.0

windows.js

45

iconfinder.js

@@ -5,2 +5,3 @@ const Icns = require('apple-icns');

const plist = require('plist');
const winIco = require('./windows').default;

@@ -28,11 +29,11 @@ const RESOURCEFORK = 'rf';

switch(process.platform) {
case 'darwin': {
if (folder.substr(folder.length - 4) === '.app') {
case 'darwin':
if (/\.app/.test(folder)) {
this.type = APPFOLDER;
} else {
let mount = folder.split('/');
if (mount[1] == 'Volumes' && mount.length > 2) {
let _mount = '/' + mount[1] + '/' + mount[2] + '/.VolumeIcon.icns';
console.log('read ' + _mount);
if (fs.existsSync(_mount)) {

@@ -48,8 +49,9 @@ this.mount = _mount;

}
}
break;
break;
case 'win32':
this.type = WINDOWS;
break;
case 'linux':
default:
break;
break;
}

@@ -145,3 +147,21 @@ }

fs.readFile(this.folder + '/Contents/Info.plist', (err,data) => {
let findApp = (folders) => {
for (let i = 0; i < folders.length; i++) {
if (folders[i].substr(folders[i].length - 4) === '.app') {
return i;
}
}
return undefined;
}
let folderIndex = findApp(this.folder.split('/'));
if (!folderIndex) {
reject('No app found');
}
let folder = this.folder.split('/').slice(0,folderIndex + 1).join('/');
fs.readFile(folder + '/Contents/Info.plist', (err,data) => {
if (err) {

@@ -157,3 +177,3 @@ return reject(err);

fs.readFile(this.folder
fs.readFile(folder
+ '/Contents/Resources/'

@@ -176,2 +196,9 @@ + info.CFBundleIconFile , (err,data) => {

case WINDOWS:
return new Promise((resolve,reject) => {
winIco(this.folder)
.then((png) => resolve(png))
.catch((err) => reject(err));
console.log('going to do this' + this.folder);
});
break;
default:

@@ -178,0 +205,0 @@ break;

6

package.json
{
"name": "hyper-folder-icon",
"version": "1.1.1",
"version": "1.2.0",
"description": "Use folder icons in MacOS and Windows with Hyper",

@@ -10,2 +10,3 @@ "main": "./index.js",

"iconfinder.js",
"windows.js",
"folder.png"

@@ -25,2 +26,5 @@ ],

"apple-icns": "git+https://github.com/moimart/node-apple-icns.git#buffer-change",
"decode-ico": "^0.2.1",
"ini-config-parser": "^1.0.3",
"jimp": "^0.2.28",
"plist": "^3.0.1",

@@ -27,0 +31,0 @@ "resourceforkjs": "0.0.4"

hyper-folder-icon
======
# Custom MacOS folder icons shown in Hyper terminal Tabs
# Custom MacOS and Windows folder icons shown in Hyper terminal Tabs

@@ -14,2 +14,6 @@ # Features for MacOS:

# Features for WINDOWS (Untested)
- Show icon from Desktop.ini file
## Optional Configuration keys

@@ -20,3 +24,3 @@

- tabIconTopMargin: default -30 -> Integer (Note: This is a pixel value)
- tabIconLeftMargin: defatul 10 -> Integer (Note: This is a percentage value)
- tabIconLeftMargin: default 10 -> Integer (Note: This is a percentage value)

@@ -23,0 +27,0 @@ ## Notes

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc