better-opn
Advanced tools
Comparing version 0.1.3 to 0.1.4
@@ -53,8 +53,9 @@ "use strict"; | ||
execSync('ps cax | grep "Google Chrome"'); | ||
execSync('osascript ../openChrome.applescript "' + encodeURI(url) + '"', { | ||
execSync(`osascript ../openChrome.applescript "${encodeURI(url)}"`, { | ||
cwd: __dirname, | ||
stdio: 'ignore' | ||
}); | ||
return true; | ||
return Promise.resolve(true); | ||
} catch (err) {// Ignore errors. | ||
// It it breaks, it will fallback to `opn` anyway | ||
} | ||
@@ -73,16 +74,8 @@ } // Another special case: on OS X, check if BROWSER has been set to "open". | ||
try { | ||
const options = _objectSpread({ | ||
app: browser | ||
}, opts); | ||
const options = _objectSpread({ | ||
app: browser | ||
}, opts); | ||
console.debug(options); | ||
require('opn')(url, options).catch(() => {}); // Prevent `unhandledRejection` error. | ||
return true; | ||
} catch (err) { | ||
return false; | ||
} | ||
console.debug(options); | ||
return require('opn')(url, options); | ||
}; | ||
@@ -89,0 +82,0 @@ |
{ | ||
"name": "better-opn", | ||
"version": "0.1.3", | ||
"version": "0.1.4", | ||
"description": "A better opn. Reuse the same tab on Chrome for 👨💻.", | ||
"main": "dist/index.js", | ||
"repository": "git@github.com:ExiaSR/better-opn.git", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/ExiaSR/better-opn" | ||
}, | ||
"author": "Michael Lin <linzichunzf@hotmail.com>", | ||
@@ -28,3 +31,5 @@ "license": "MIT", | ||
"scripts": { | ||
"build": "babel src -d dist" | ||
"build": "babel src -d dist", | ||
"lint": "eslint src --fix", | ||
"format": "prettier --write \"src/**/*.js\"" | ||
}, | ||
@@ -38,5 +43,5 @@ "dependencies": { | ||
"@babel/preset-env": "^7.2.0", | ||
"eslint": "^5.2.0", | ||
"eslint-config-prettier": "^2.9.0", | ||
"eslint-plugin-prettier": "^2.6.2", | ||
"eslint": "^5.10.0", | ||
"eslint-config-prettier": "^3.3.0", | ||
"eslint-plugin-prettier": "^3.0.0", | ||
"opn": "^5.4.0", | ||
@@ -43,0 +48,0 @@ "prettier": "^1.13.7" |
@@ -7,11 +7,6 @@ # better-opn | ||
`opn` is a peer dependency, make sure you install it as well. | ||
> `$ yarn add better-opn` | ||
```bash | ||
yarn add opn better-opn | ||
``` | ||
> `$ npm install better-opn` | ||
```bash | ||
npm install opn better-opn | ||
``` | ||
@@ -30,2 +25,2 @@ ## Usage | ||
- [Michael Lin](mailto:linzichunzf@hotmail.com) | ||
- [Michael Lin](https://michaellin.me) |
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
No repository
Supply chain riskPackage does not have a linked source code repository. Without this field, a package will have no reference to the location of the source code use to generate the package.
Found 1 instance in 1 package
1
122611
78
25