launch-editor
Advanced tools
+2
-1
@@ -38,2 +38,3 @@ const path = require('path') | ||
| case 'Code': | ||
| case 'codium': | ||
| return ['-r', '-g', `${fileName}:${lineNumber}:${columnNumber}`] | ||
@@ -53,3 +54,3 @@ case 'appcode': | ||
| case 'webstorm64': | ||
| return ['--line', lineNumber, fileName] | ||
| return ['--line', lineNumber, '--column', columnNumber, fileName] | ||
| } | ||
@@ -56,0 +57,0 @@ |
+23
-9
@@ -27,3 +27,3 @@ const path = require('path') | ||
| const output = childProcess | ||
| .execSync('ps x', { | ||
| .execSync('ps x -o comm=', { | ||
| stdio: ['pipe', 'pipe', 'ignore'] | ||
@@ -33,21 +33,35 @@ }) | ||
| const processNames = Object.keys(COMMON_EDITORS_OSX) | ||
| const processList = output.split('\n') | ||
| for (let i = 0; i < processNames.length; i++) { | ||
| const processName = processNames[i] | ||
| // Find editor by exact match. | ||
| if (output.indexOf(processName) !== -1) { | ||
| return [COMMON_EDITORS_OSX[processName]] | ||
| } | ||
| const processNameWithoutApplications = processName.replace('/Applications', '') | ||
| // Find editor installation not in /Applications. | ||
| if (output.indexOf(processNameWithoutApplications) !== -1) { | ||
| // Use the CLI command if one is specified | ||
| if (processName !== COMMON_EDITORS_OSX[processName]) { | ||
| return [COMMON_EDITORS_OSX[processName]] | ||
| } | ||
| // Use a partial match to find the running process path. If one is found, use the | ||
| // existing path since it can be running from anywhere. | ||
| const runningProcess = processList.find((procName) => procName.endsWith(processNameWithoutApplications)) | ||
| if (runningProcess !== undefined) { | ||
| return [runningProcess] | ||
| } | ||
| } | ||
| } | ||
| } else if (process.platform === 'win32') { | ||
| const output = childProcess | ||
| .execSync('powershell -Command "Get-Process | Select-Object Path"', { | ||
| stdio: ['pipe', 'pipe', 'ignore'] | ||
| }) | ||
| .execSync( | ||
| 'powershell -NoProfile -Command "Get-CimInstance -Query \\"select executablepath from win32_process where executablepath is not null\\" | % { $_.ExecutablePath }"', | ||
| { | ||
| stdio: ['pipe', 'pipe', 'ignore'] | ||
| } | ||
| ) | ||
| .toString() | ||
| const runningProcesses = output.split('\r\n') | ||
| for (let i = 0; i < runningProcesses.length; i++) { | ||
| // `Get-Process` sometimes returns empty lines | ||
| if (!runningProcesses[i]) { | ||
| continue | ||
| } | ||
| const fullProcessPath = runningProcesses[i].trim() | ||
@@ -54,0 +68,0 @@ const shortProcessName = path.basename(fullProcessPath) |
+2
-2
| { | ||
| "name": "launch-editor", | ||
| "version": "2.4.0", | ||
| "version": "2.5.0", | ||
| "description": "launch editor from node.js", | ||
@@ -22,4 +22,4 @@ "main": "index.js", | ||
| "picocolors": "^1.0.0", | ||
| "shell-quote": "^1.6.1" | ||
| "shell-quote": "^1.7.3" | ||
| } | ||
| } |
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
Shell access
Supply chain riskThis module accesses the system shell. Accessing the system shell increases the risk of executing arbitrary code.
Found 1 instance in 1 package
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 2 instances in 1 package
Filesystem access
Supply chain riskAccesses the file system, and could potentially read sensitive data.
Found 1 instance in 1 package
12122
8.35%337
4.98%Updated