alfred-fkill
Advanced tools
Comparing version 0.1.0 to 0.2.0
29
index.js
'use strict'; | ||
const alfy = require('alfy'); | ||
const psList = require('ps-list'); | ||
const pathExists = require('path-exists'); | ||
const util = require('./lib/util'); | ||
@@ -9,8 +9,9 @@ psList().then(data => { | ||
.inputMatches(data, 'name') | ||
.filter(process => !process.name.endsWith(' Helper')) | ||
.map(process => { | ||
let icon = `./icons/${process.name.replace(/ Helper$/, '')}.png`; | ||
const cleanedPath = process.cmd.replace(/\.app\/Contents\/.*$/, '.app'); | ||
if (!pathExists.sync(icon)) { | ||
icon = './icon.png'; | ||
} | ||
// TODO: Use the `process.path` property in `ps-list` when implemented there | ||
// The below can be removed then | ||
const pathForIcon = cleanedPath.replace(/ -.*/, ''); // Removes arguments | ||
@@ -20,6 +21,8 @@ return { | ||
autocomplete: process.name, | ||
subtitle: process.cmd, | ||
// TODO; Use `process.path` property | ||
subtitle: cleanedPath, | ||
arg: process.pid, | ||
icon: { | ||
path: icon | ||
type: 'fileicon', | ||
path: pathForIcon | ||
}, | ||
@@ -29,9 +32,17 @@ mods: { | ||
subtitle: 'Force kill', | ||
arg: `${process.pid} force` | ||
arg: JSON.stringify({ | ||
alfredworkflow: { | ||
arg: process.pid, | ||
variables: { | ||
force: true | ||
} | ||
} | ||
}) | ||
} | ||
} | ||
}; | ||
}); | ||
}) | ||
.sort(util.sorter); | ||
alfy.output(items); | ||
}); |
'use strict'; | ||
const fkill = require('fkill'); | ||
const args = process.argv[2].split(' '); | ||
fkill(parseInt(args[0], 10), { | ||
force: args[1] === 'force' | ||
fkill(parseInt(process.argv[2], 10), { | ||
force: Boolean(process.env.force) | ||
}); |
{ | ||
"name": "alfred-fkill", | ||
"version": "0.1.0", | ||
"version": "0.2.0", | ||
"description": "Alfred 3 workflow to fabulously search and kill processes", | ||
@@ -18,4 +18,3 @@ "license": "MIT", | ||
"postinstall": "alfy-init", | ||
"preuninstall": "alfy-cleanup", | ||
"icons": "./icns2png.js icns icons" | ||
"preuninstall": "alfy-cleanup" | ||
}, | ||
@@ -26,4 +25,3 @@ "files": [ | ||
"icon.png", | ||
"info.plist", | ||
"icons" | ||
"info.plist" | ||
], | ||
@@ -46,3 +44,2 @@ "keywords": [ | ||
"fkill": "^4.1.0", | ||
"path-exists": "^3.0.0", | ||
"ps-list": "^3.1.0" | ||
@@ -53,5 +50,4 @@ }, | ||
"ava": "*", | ||
"iconutil": "^1.0.2", | ||
"xo": "*" | ||
} | ||
} |
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
3
3
46
9688
7
2
- Removedpath-exists@^3.0.0