Skip to content

Commit

Permalink
Merge pull request #3 from gyselroth/dev
Browse files Browse the repository at this point in the history
v1.0.2
  • Loading branch information
raffis committed Dec 11, 2018
2 parents d34e3d1 + 3f5e65a commit fe43e25
Show file tree
Hide file tree
Showing 5 changed files with 25 additions and 5 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,17 @@
## 1.0.2
**Maintainer**: Raffael Sahli <sahli@gyselroth.net>\
**Date**: Tue December 11 14:59:22 CET 2018

* [FIX] possibility to specify context.cmd on nodeIcon.setFolderIcon


## 1.0.1
**Maintainer**: Raffael Sahli <sahli@gyselroth.net>\
**Date**: Tue December 11 14:51:22 CET 2018

* [FEATURE] possibility to specify context.cmd on nodeIcon.setFolderIcon


## 1.0.0
**Maintainer**: Raffael Sahli <sahli@gyselroth.net>\
**Date**: Tue December 11 13:48:22 CET 2018
Expand Down
10 changes: 8 additions & 2 deletions lib/darwin.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,10 +21,16 @@ async function ensureItem(node, context) {
return osx.addItem(parsePath(node));
}

function setFolderIcon(node, icon) {
function setFolderIcon(node, icon, context) {
return new Promise(async (resolve, reject) => {
var cmd = require.resolve('fileicon/bin/fileicon');

if(context && context.cmd) {
cmd = context.cmd;
}

exec([
'node_modules/fileicon/bin/fileicon',
cmd,
'set',
node,
icon
Expand Down
2 changes: 1 addition & 1 deletion lib/linux.js
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,7 @@ async function ensureItem(node, context) {
}
}

async function setFolderIcon(node, icon) {
async function setFolderIcon(node, icon, context) {
return exec([
'gvfs-set-attribute',
node,
Expand Down
2 changes: 1 addition & 1 deletion lib/win32.js
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,7 @@ async function ensureItem(node, context) {
regKey.set('{'+context.clsId+'}', 'REG_DWORD', '0x1', (result) => {});
}

function setFolderIcon(node, icon) {
function setFolderIcon(node, icon, context) {
var content = "[.ShellClassInfo]\
ConfirmFileOp=0\
NoSharing=1\
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@gyselroth/node-advanced-desktop",
"version": "1.0.0",
"version": "1.0.2",
"description": "Manage sidebar bookmarks (folder favourites) and folder icons compatible on Linux, Windows and OS X",
"main": "lib/main.js",
"scripts": {
Expand Down

0 comments on commit fe43e25

Please sign in to comment.