add command upcoming
This commit is contained in:
parent
36e2aade92
commit
385c09896a
@ -6,7 +6,7 @@ project:
|
|||||||
releases:
|
releases:
|
||||||
- version: NEXT
|
- version: NEXT
|
||||||
changes:
|
changes:
|
||||||
- port the Perl changelord to JavaScript.
|
- port the core of the Perl changelord to JavaScript.
|
||||||
change_types:
|
change_types:
|
||||||
- title: ""
|
- title: ""
|
||||||
level: minor
|
level: minor
|
||||||
|
@ -12,6 +12,7 @@ import init from "./command/init.js";
|
|||||||
import schema from "./command/schema.js";
|
import schema from "./command/schema.js";
|
||||||
import add from "./command/add.js";
|
import add from "./command/add.js";
|
||||||
import cut from "./command/cut.js";
|
import cut from "./command/cut.js";
|
||||||
|
import upcoming from "./command/upcoming.js";
|
||||||
|
|
||||||
consola.raw = (...args) => console.log(...args);
|
consola.raw = (...args) => console.log(...args);
|
||||||
|
|
||||||
@ -27,5 +28,6 @@ yargs(hideBin(process.argv))
|
|||||||
.command(schema)
|
.command(schema)
|
||||||
.command(cut)
|
.command(cut)
|
||||||
.command(print)
|
.command(print)
|
||||||
|
.command(upcoming)
|
||||||
.help()
|
.help()
|
||||||
.parse();
|
.parse();
|
||||||
|
24
src/command/upcoming.js
Normal file
24
src/command/upcoming.js
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
import u from "@yanick/updeep-remeda";
|
||||||
|
import fs from "fs-extra";
|
||||||
|
import yaml from "yaml";
|
||||||
|
import { render_release } from "./print.js";
|
||||||
|
|
||||||
|
const handler = async (config) => {
|
||||||
|
const source = await fs.readFile(config.source, "utf-8").then(yaml.parse);
|
||||||
|
|
||||||
|
const res = render_release(
|
||||||
|
{ ...config, next: true },
|
||||||
|
source
|
||||||
|
)(source.releases.find(u.matches({ version: "NEXT" })));
|
||||||
|
|
||||||
|
config.consola.raw("\n" + res.body);
|
||||||
|
};
|
||||||
|
|
||||||
|
export default {
|
||||||
|
command: "upcoming",
|
||||||
|
desc: "output the changes in NEXT",
|
||||||
|
builder: (yargs) => {
|
||||||
|
yargs;
|
||||||
|
},
|
||||||
|
handler,
|
||||||
|
};
|
Loading…
Reference in New Issue
Block a user