add command upcoming
This commit is contained in:
parent
36e2aade92
commit
385c09896a
@ -6,7 +6,7 @@ project:
|
||||
releases:
|
||||
- version: NEXT
|
||||
changes:
|
||||
- port the Perl changelord to JavaScript.
|
||||
- port the core of the Perl changelord to JavaScript.
|
||||
change_types:
|
||||
- title: ""
|
||||
level: minor
|
||||
|
@ -12,6 +12,7 @@ import init from "./command/init.js";
|
||||
import schema from "./command/schema.js";
|
||||
import add from "./command/add.js";
|
||||
import cut from "./command/cut.js";
|
||||
import upcoming from "./command/upcoming.js";
|
||||
|
||||
consola.raw = (...args) => console.log(...args);
|
||||
|
||||
@ -27,5 +28,6 @@ yargs(hideBin(process.argv))
|
||||
.command(schema)
|
||||
.command(cut)
|
||||
.command(print)
|
||||
.command(upcoming)
|
||||
.help()
|
||||
.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