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

dorun

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

dorun - npm Package Compare versions

Comparing version 0.0.1 to 0.0.2

TODO.md

48

dorun.js
#!/usr/bin/env node
'use strict'
"use strict";
var mountPath = "/work/input";
var dockerPreArgs = "-it --rm";
// @STCGoal Whatever the platform, the docker runs with the current dir mounted as /work/input
//
var os = require("os");
var myArgs = process.argv.slice(2);
//@STCGoal Platform
var p = process.platform;
console.log("LINUX>docker run -it --rm $(pwd)/:/work/input $1");
console.log("PowerShell>docker run -it --rm ${pwd}/:/work/input $1");
console.log("WIN>docker run -it --rm %cd%/:/work/input $1");
if (myArgs[0] == "--testos") {
console.log(p);
console.log(os.type()); // "Windows_NT"
console.log(os.release()); // "10.0.14393"
console.log(os.platform()); // "win32"
}
var cdirString = "";
console.log("Nodejs How to detect platform context ? ")
if (p == "linux") {
cdirString = "$(pwd)/";
} else if (p == "win32") {
//win
cdirString = "${pwd}/";
} else if (p == "cygwin") {
//win
cdirString = "%cd%";
} else cdirString = "$(pwd)/";
if (myArgs[0] == "--help") {
console.log("LINUX>docker run -it --rm $(pwd)/:/work/input $1");
console.log("PowerShell>docker run -it --rm ${pwd}/:/work/input $1");
console.log("WIN>docker run -it --rm %cd%/:/work/input $1");
}
var cmdAndArgs = " "
myArgs.forEach(a => {
cmdAndArgs += a + " ";
});
//@STCGoal Support X11Forwarding
//@action $(/sbin/ip route|awk '/default/ { print $3 }'):0
console.log(`docker run ${dockerPreArgs} -v ${cdirString}:${mountPath} ${cmdAndArgs }`);
// console.log("Nodejs How to detect platform context ? ");
//@STCGoal ...

2

package.json
{
"name": "dorun",
"version": "0.0.1",
"version": "0.0.2",
"description": "Run a docker container with current dir mounted as /work/input",

@@ -5,0 +5,0 @@ "main": "dorun.js",

# dorun
Docker run and mount current dir
##--@STCStatus In progress
## Install
```sh
sudo npm i dorun --g
```
## Usage
```sh
dorun jgwill/ubuntu
````
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