From e9ad82c2382bf8db6b907b2e0a682e8cf7dd89e8 Mon Sep 17 00:00:00 2001 From: Sindre Sorhus Date: Mon, 13 May 2019 12:21:06 +0700 Subject: [PATCH] Rename the project from `opn-cli` to `open-cli` And the binary from `opn` to `open-cli`. --- .travis.yml | 1 + cli.js | 18 +++++++++--------- package.json | 16 +++++++--------- readme.md | 22 +++++++++++----------- 4 files changed, 28 insertions(+), 29 deletions(-) diff --git a/.travis.yml b/.travis.yml index f3fa8cd..f98fed0 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,4 +1,5 @@ language: node_js node_js: + - '12' - '10' - '8' diff --git a/cli.js b/cli.js index 9d182e0..f4df290 100755 --- a/cli.js +++ b/cli.js @@ -8,8 +8,8 @@ const fileType = require('file-type'); const cli = meow(` Usage - $ opn [--wait] [--background] [-- [args]] - $ cat | opn [--ext] [--wait] [--background] [-- [args]] + $ open-cli [--wait] [--background] [-- [args]] + $ cat | open-cli [--ext] [--wait] [--background] [-- [args]] Options --wait Wait for the app to exit @@ -17,12 +17,12 @@ const cli = meow(` --ext File extension for when stdin file type can't be detected Examples - $ opn https://sindresorhus.com - $ opn https://sindresorhus.com -- firefox - $ opn https://sindresorhus.com -- 'google chrome' --incognito - $ opn unicorn.png - $ cat unicorn.png | opn - $ echo '

Unicorns!

' | opn --ext=html + $ open-cli https://sindresorhus.com + $ open-cli https://sindresorhus.com -- firefox + $ open-cli https://sindresorhus.com -- 'google chrome' --incognito + $ open-cli unicorn.png + $ cat unicorn.png | open-cli + $ echo '

Unicorns!

' | open-cli --ext=html `, { flags: { wait: { @@ -55,6 +55,6 @@ if (input) { const stdin = await getStdin.buffer(); const type = fileType(stdin); const ext = cli.flags.ext || (type && type.ext) || 'txt'; - open(tempWrite.sync(stdin, `opn.${ext}`), cli.flags); + open(tempWrite.sync(stdin, `open.${ext}`), cli.flags); })(); } diff --git a/package.json b/package.json index 07aa0fc..48539cb 100644 --- a/package.json +++ b/package.json @@ -1,16 +1,16 @@ { - "name": "opn-cli", + "name": "open-cli", "version": "4.1.0", "description": "Open stuff like URLs, files, executables. Cross-platform.", "license": "MIT", - "repository": "sindresorhus/opn-cli", + "repository": "sindresorhus/open-cli", "author": { "name": "Sindre Sorhus", "email": "sindresorhus@gmail.com", "url": "sindresorhus.com" }, "bin": { - "opn": "cli.js" + "open-cli": "cli.js" }, "engines": { "node": ">=8" @@ -26,7 +26,6 @@ "cli", "app", "open", - "opn", "opener", "opens", "launch", @@ -42,7 +41,6 @@ "url", "urls", "arguments", - "args", "spawn", "exec", "child", @@ -51,11 +49,11 @@ "file" ], "dependencies": { - "file-type": "^10.10.0", - "get-stdin": "^6.0.0", + "file-type": "^11.0.0", + "get-stdin": "^7.0.0", "meow": "^5.0.0", - "open": "^6.1.0", - "temp-write": "^3.4.0" + "open": "^6.3.0", + "temp-write": "^4.0.0" }, "devDependencies": { "ava": "^1.4.1", diff --git a/readme.md b/readme.md index e0c048d..53d1468 100644 --- a/readme.md +++ b/readme.md @@ -1,4 +1,4 @@ -# opn-cli [![Build Status](https://travis-ci.org/sindresorhus/opn-cli.svg?branch=master)](https://travis-ci.org/sindresorhus/opn-cli) +# open-cli [![Build Status](https://travis-ci.org/sindresorhus/open-cli.svg?branch=master)](https://travis-ci.org/sindresorhus/open-cli) > Open stuff like URLs, files, executables. Cross-platform. @@ -6,18 +6,18 @@ ## Install ``` -$ npm install --global opn-cli +$ npm install --global open-cli ``` ## Usage ``` -$ opn --help +$ open-cli --help Usage - $ opn [--wait] [--background] [-- [args]] - $ cat | opn [--ext] [--wait] [--background] [-- [args]] + $ open-cli [--wait] [--background] [-- [args]] + $ cat | open-cli [--ext] [--wait] [--background] [-- [args]] Options --wait Wait for the app to exit @@ -25,12 +25,12 @@ $ opn --help --ext File extension for when stdin file type can't be detected Examples - $ opn https://sindresorhus.com - $ opn https://sindresorhus.com -- firefox - $ opn https://sindresorhus.com -- 'google chrome' --incognito - $ opn unicorn.png - $ cat unicorn.png | opn - $ echo '

Unicorns!

' | opn --ext=html + $ open-cli https://sindresorhus.com + $ open-cli https://sindresorhus.com -- firefox + $ open-cli https://sindresorhus.com -- 'google chrome' --incognito + $ open-cli unicorn.png + $ cat unicorn.png | open-cli + $ echo '

Unicorns!

' | open-cli --ext=html ``` The [following file types](https://github.com/sindresorhus/file-type#supported-file-types) are automagically detected when using stdin mode.