dotnet-run
Advanced tools
Comparing version
35
index.js
@@ -1,34 +0,9 @@ | ||
const fs = require('fs'); | ||
const path = require('path'); | ||
const {spawn} = require('child_process'); | ||
const { spawn } = require("child_process") | ||
module.exports = (filename, args, callback) => { | ||
const options = {stdio: 'inherit'}; | ||
if (filename) | ||
args.unshift(filename) | ||
if (path.sep == '\\') | ||
spawn(filename, args, options).on('exit', callback); | ||
else { | ||
if (filename) | ||
args.unshift(filename); | ||
const home = process.env.DOTNET_RUN_HOME || | ||
path.join(process.env.HOME, '.dotnet-run'); | ||
const mono = path.join(home, '.bin', 'mono'); | ||
if (fs.existsSync(mono)) | ||
spawn(mono, args, options).on('exit', callback); | ||
else { | ||
// Fallback to install script. | ||
spawn('bash', [ | ||
path.join(__dirname, 'src', 'install.bash') | ||
], { | ||
stdio: 'inherit' | ||
}).on('exit', code => { | ||
if (code == 0) | ||
spawn(mono, args, options).on('exit', callback); | ||
else if (callback) | ||
callback(code) | ||
}); | ||
} | ||
} | ||
spawn("dotnet", args, { stdio: "inherit" }) | ||
.on("exit", callback) | ||
} |
{ | ||
"name": "dotnet-run", | ||
"version": "1.5.0", | ||
"version": "2.0.0-beta.0", | ||
"description": "Run Mono and .NET programs easily on all platforms.", | ||
@@ -9,3 +9,2 @@ "bin": { | ||
"scripts": { | ||
"install": "node src/install.js", | ||
"test": "node test/test.js" | ||
@@ -15,3 +14,2 @@ }, | ||
"bin/*", | ||
"src/*", | ||
"index.js" | ||
@@ -24,6 +22,5 @@ ], | ||
"keywords": [ | ||
"mono", | ||
"cross-platform", | ||
"dotnet", | ||
"cross-platform", | ||
"installer" | ||
"helper" | ||
], | ||
@@ -30,0 +27,0 @@ "author": "Morten Daniel Fornes", |
# dotnet-run | ||
[](https://ci.appveyor.com/project/mortend/dotnet-run/branch/master) | ||
[](https://travis-ci.org/mortend/dotnet-run) | ||
[](https://www.npmjs.com/package/dotnet-run) | ||
@@ -10,3 +9,3 @@ [](https://www.npmjs.com/package/dotnet-run) | ||
> Run Mono and .NET programs easily on all platforms. | ||
> Run .NET programs easily on all platforms | ||
@@ -18,29 +17,2 @@ ## Install | ||
``` | ||
This will detect [Mono](https://www.mono-project.com/)/.NET or automatically download a suitable version for your system. | ||
### macOS | ||
 | ||
 | ||
 | ||
Unless we can find Mono v6.0.0.311 or greater on your system, we will provide you a minimal Mono installation automatically. | ||
> We provide minimal Mono releases for macOS, much smaller than official releases. Our v6.0.0.311 is distributed as a 33.6 MB tarball, which installs faster and is more than ten times smaller than the official pkg installer at 362.2 MB. Our package is unobtrusive to your system and will safely co-exist with any existing Mono install you may or may not have from before. | ||
### Linux | ||
 | ||
 | ||
Linux users must provide their own Mono install before consuming this package. More information can be found on [this page](https://www.mono-project.com/download/). | ||
### Windows | ||
 | ||
 | ||
We use the built-in .NET Framework on Windows. | ||
## Usage | ||
@@ -53,3 +25,3 @@ | ||
run('bang.exe', ['pong', 'pang'], process.exit); | ||
run('hello.dll', ['javascript', 'typescript'], process.exit); | ||
``` | ||
@@ -60,26 +32,9 @@ | ||
``` | ||
$ dotnet-run bang.exe pong pang | ||
$ dotnet-run hello.dll javascript typescript | ||
Hello, pong pang! | ||
Hello, javascript and typescript! | ||
``` | ||
``` | ||
$ dotnet-run --version | ||
Mono JIT compiler version 6.0.0.311 (2019-02/494641b300c Mon Jul 1 20:30:26 EDT 2019) | ||
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com | ||
TLS: | ||
SIGSEGV: altstack | ||
Notification: kqueue | ||
Architecture: amd64 | ||
Disabled: none | ||
Misc: softdebug | ||
Interpreter: yes | ||
LLVM: yes(600) | ||
Suspend: hybrid | ||
GC: sgen (concurrent by default) | ||
``` | ||
## Contributing | ||
Please [report an issue](https://github.com/mortend/dotnet-run/issues) if you encounter a problem, or [open a pull request](https://github.com/mortend/dotnet-run/pulls) if you make a patch. |
Sorry, the diff of this file is not supported yet
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
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
Install scripts
Supply chain riskInstall scripts are run when the package is installed. The majority of malware in npm is hidden in install scripts.
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
0
-100%0
-100%3284
-76.67%5
-50%10
-94.62%1
Infinity%37
-54.88%