Socket
Socket
Sign inDemoInstall

capistrano-ssh-wrapper

Package Overview
Dependencies
32
Maintainers
1
Versions
13
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 1.0.3 to 1.0.4

2

package.json

@@ -9,3 +9,3 @@ {

"description": "[![Greenkeeper badge](https://badges.greenkeeper.io/grrr-amsterdam/capistrano-ssh-wrapper.svg)](https://greenkeeper.io/)",
"version": "1.0.3",
"version": "1.0.4",
"main": "wrapper.js",

@@ -12,0 +12,0 @@ "devDependencies": {},

@@ -23,29 +23,62 @@ #!/usr/bin/env node

if (line.startsWith('server')) {
var userhost = /server ['"]+(.*)@(.*)['"]+/g;
var match = userhost.exec(line);
if (match.length < 2) {
var e = 'Could not find SSH config.'
error.exit(e)
var parsed = parser._parseSshServerLine(line)
if (!parsed) {
parsed = parser._parseSshServerSeparateUserLine(line)
}
return {
user: match[1],
host: match[2]
}
return parsed
}
if (line.startsWith('set :deploy_to')) {
var dir = /:deploy_to, ['"]+(.*)['"]+/g;
var match = dir.exec(line);
if (match.length < 1) {
var e = 'Could not find SSH deploy dir config.'
error.exit(e)
}
return parser._parseSshDeployLine(line)
}
},
return {
dir: match[1]
}
_parseSshServerLine: function(line) {
var userhost = /server ['"]+(.*)@(.*)['"]+/g;
var match = userhost.exec(line);
if (
!('length' in match) ||
match.length < 2
) {
return
}
return {
user: match[1],
host: match[2]
}
},
_parseSshServerSeparateUserLine: function(line) {
var userhost = /server ['"]+(.*)['"]+user: ['"]+(.*)['"]/g;
var match = userhost.exec(line);
if (
!('length' in match) ||
match.length < 2
) {
return
}
return {
host: match[1],
user: match[2]
}
},
_parseSshDeployLine: function(line) {
var dir = /:deploy_to, ['"]+(.*)['"]+/g;
var match = dir.exec(line);
if (match.length < 1) {
var e = 'Could not find SSH deploy dir config.'
error.exit(e)
}
return {
dir: match[1]
}
}
};
SocketSocket SOC 2 Logo

Product

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

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc