Merge pull request #77 from captn3m0/update-notice

Add package-upgrade notice and --version
This commit is contained in:
Nemo 2021-07-29 11:48:49 +05:30 committed by GitHub
commit 8724ba85aa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 1452 additions and 57 deletions

View File

@ -7,6 +7,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
## Unreleased
### Added
- `--version` is now supported
- An update notification is shown if the package isn't latest.
## 1.0.6 - 2021-07-29
### Added

View File

@ -5,12 +5,18 @@ import { parse } from "./src/parser.js";
import { generate } from "./src/cue.js";
import minimist from "minimist";
import exit from "process";
import updateNotifier from "update-notifier";
import pkg from "./src/package.js";
updateNotifier({ pkg }).notify();
let argv = minimist(process.argv.slice(2), {
string: "audio-file",
});
if (argv._.length < 1 || argv.help) {
if (argv.version) {
console.log(pkg.version);
} else if (argv._.length < 1 || argv.help) {
console.log(`Usage
$ youtube-cue [--audio-file audio.m4a] <youtube_url> [output_file]
@ -32,6 +38,8 @@ if (argv._.length < 1 || argv.help) {
The above 2 are only needed to force behaviour in very specific edge cases, they should
not be required for most files.
--version Print version
Examples
$ youtube-cue --audio-file audio.m4a "https://www.youtube.com/watch?v=THzUassmQwE"
"T A Y L O R S W I F T Folklore [Full album].cue" saved

1489
package-lock.json generated

File diff suppressed because it is too large Load Diff

View File

@ -18,6 +18,7 @@
"console-log-level": "^1.4.1",
"get-artist-title": "^1.3.1",
"minimist": "^1.2.5",
"update-notifier": "^5.1.0",
"ytdl-core": "^4.8.2"
},
"repository": {

5
src/package.js Normal file
View File

@ -0,0 +1,5 @@
import { createRequire } from "module";
const require = createRequire(import.meta.url);
const data = require("../package.json");
export default data;