Merge pull request #77 from captn3m0/update-notice
Add package-upgrade notice and --version
This commit is contained in:
commit
8724ba85aa
|
@ -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
|
||||
|
|
10
index.js
10
index.js
|
@ -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
|
||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -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": {
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
import { createRequire } from "module";
|
||||
const require = createRequire(import.meta.url);
|
||||
const data = require("../package.json");
|
||||
|
||||
export default data;
|
Loading…
Reference in New Issue