Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

launch-editor

Package Overview
Dependencies
Maintainers
2
Versions
14
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

launch-editor - npm Package Compare versions

Comparing version 2.4.0 to 2.5.0

3

get-args.js

@@ -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 @@

@@ -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)

{
"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"
}
}
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