@ibm-functions/shell-local-plugin
Advanced tools
Comparing version 0.0.21 to 0.0.22
{ | ||
"name": "@ibm-functions/shell-local-plugin", | ||
"version": "0.0.21", | ||
"version": "0.0.22", | ||
"description": "An IBM Cloud Functions Shell plugin that lets users run and debug actions locally in a docker container", | ||
@@ -5,0 +5,0 @@ "main": "plugin.js", |
@@ -25,3 +25,3 @@ /* | ||
{ kindToExtension } = require('./kinds'), | ||
docker = new Docker(), | ||
docker = new Docker({ socketPath: '/var/run/docker.sock' }), | ||
$ = require('jquery'), | ||
@@ -33,2 +33,8 @@ rt = require('requestretry'), | ||
const promisifyStream = stream => new Promise((resolve, reject) => { | ||
stream.on('data', data => console.log(data.toString())) | ||
stream.on('end', resolve) | ||
stream.on('error', reject) | ||
}) | ||
debug('modules loaded') | ||
@@ -389,2 +395,4 @@ | ||
debug('using image', image) | ||
// separate image name and tag. tag is always 'latest'. | ||
if(image.indexOf(':') !== -1) image = image.substring(0, image.indexOf(':')); | ||
@@ -399,3 +407,7 @@ debug('checking to see if the image already exists locally') | ||
appendIncreContent(`Pulling image (one-time init)`, spinnerDiv); | ||
return Promise.all([image, repl.qexec(`! docker pull ${image}`)]); | ||
return Promise.all([image, | ||
docker.image.create({}, {fromImage: image, tag:'latest'}) | ||
.then(stream => promisifyStream(stream)) | ||
.then(() => docker.image.get(image).status()) | ||
]); | ||
} | ||
@@ -406,7 +418,7 @@ } | ||
if(!Array.isArray(d)){ | ||
debug('skipping docker create') | ||
debug('skipping docker container create') | ||
return Promise.resolve(d); | ||
} | ||
else{ | ||
debug('docker create') | ||
debug('docker container create') | ||
return docker.container.create(Object.assign({Image: d[0]}, dockerConfig)) | ||
@@ -413,0 +425,0 @@ } |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
72727
1031
1