eshost-cli
Advanced tools
Comparing version 7.4.1 to 7.5.0
@@ -33,4 +33,26 @@ 'use strict'; | ||
this.hosts = this.hosts || {}; | ||
for (const hostName in this.hosts) { | ||
const host = this.hosts[hostName]; | ||
if (typeof host !== 'object' || host === null) { | ||
continue; | ||
} | ||
host.path = this.resolvePath(host.path); | ||
} | ||
} | ||
resolvePath(input) { | ||
if (input.startsWith('~/')) { | ||
return path.join(os.homedir(), input.slice(2)); | ||
} else if (input === '~') { | ||
return os.homedir(); | ||
} else if (!path.isAbsolute(input)) { | ||
return path.join(path.dirname(this.configPath), input); | ||
} else { | ||
return input; | ||
} | ||
} | ||
save() { | ||
@@ -37,0 +59,0 @@ fs.writeFileSync(this.configPath, JSON.stringify(this, null, 2), 'utf8'); |
{ | ||
"name": "eshost-cli", | ||
"version": "7.4.1", | ||
"version": "7.5.0", | ||
"description": "Run scripts in any ECMAScript host", | ||
@@ -22,3 +22,4 @@ "bin": { | ||
"scripts": { | ||
"test": "mocha test/bin/eshost.js" | ||
"build:env": "./scripts/prepare-environment.sh", | ||
"test": "export $(./scripts/prepare-environment.sh); mocha test/bin/eshost.js" | ||
}, | ||
@@ -25,0 +26,0 @@ "repository": { |
@@ -32,3 +32,3 @@ # eshost-cli | ||
``` | ||
```sh | ||
npm install esvu -g; | ||
@@ -48,3 +48,3 @@ export PATH="${HOME}/.jsvu/bin:${PATH}"; | ||
npm install -g eshost; | ||
npm install -g eshost-cli; | ||
@@ -63,3 +63,3 @@ eshost --add "chakra" ch $ESHOST_PATH_CHAKRA; | ||
``` | ||
```sh | ||
# Engine262 | ||
@@ -85,3 +85,3 @@ git clone https://github.com/devsnek/engine262.git; | ||
npm install -g eshost; | ||
npm install -g eshost-cli; | ||
@@ -100,4 +100,4 @@ eshost --add "chakra" ch $ESHOST_PATH_CHAKRA; | ||
``` | ||
if [ "$(uname)" == "Darwin" ]; then wget https://bellard.org/quickjs/quickjs-2020-01-19.tar.xz; tar -xf quickjs-2020-01-19.tar.xz; | ||
```sh | ||
if [ "$(uname)" = Darwin ]; then wget https://bellard.org/quickjs/quickjs-2020-01-19.tar.xz; tar -xf quickjs-2020-01-19.tar.xz; | ||
cd quickjs-2020-01-19 && make; if [ -f "$PWD/run-test262" ]; then ln -s $PWD/run-test262 /usr/local/bin/qjs-for-eshost; fi; fi; | ||
@@ -114,3 +114,3 @@ ``` | ||
``` | ||
```batch | ||
git clone https://github.com/devsnek/engine262.git | ||
@@ -136,3 +136,3 @@ cd .\engine262 | ||
npm install -g eshost; | ||
npm install -g eshost-cli; | ||
@@ -148,3 +148,3 @@ eshost --add "chakra" ch %ESHOST_CHAKRA% | ||
``` | ||
```console | ||
$ npm install -g eshost-cli | ||
@@ -174,3 +174,3 @@ $ eshost --help | ||
``` | ||
```console | ||
$ eshost --configure-esvu --esvu-prefix esvu | ||
@@ -190,3 +190,3 @@ $ eshost --tags esvu-web -itsx "let a = 40+2; print(a)" | ||
``` | ||
```console | ||
$ eshost --configure-jsvu --jsvu-prefix jsvu | ||
@@ -212,3 +212,3 @@ $ eshost --tags jsvu-web -itsx "let a = 40+2; print(a)" | ||
``` | ||
```sh | ||
mkdir entry-point-mjs; | ||
@@ -238,3 +238,3 @@ cd entry-point-mjs; | ||
``` | ||
```sh | ||
mkdir entry-point-js; | ||
@@ -297,2 +297,1 @@ cd entry-point-js; | ||
| safari | `safari` | | ||
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
676
31437
285