Skip to content

Commit

Permalink
chore(dev-utils): autoConfirm flag passed to initBlog
Browse files Browse the repository at this point in the history
  • Loading branch information
mlaursen committed Jul 27, 2021
1 parent 9a1f1f2 commit dec09b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion packages/dev-utils/src/release.ts
Expand Up @@ -116,7 +116,7 @@ A token can be created at:

await changelogData();
run(`npx lerna version ${type} --no-push${yes}`);
const changelog = await initBlog();
const changelog = await initBlog(autoYes);

const percentChanged = await libsize({
umd: true,
Expand Down
8 changes: 4 additions & 4 deletions packages/dev-utils/src/utils/initBlog.ts
Expand Up @@ -9,9 +9,9 @@ import { verify } from "./verify";

const NEW_ENTRY = /^#{1,2}\s+\[\d/;

async function getCurrentReleaseNotes(): Promise<string> {
async function getCurrentReleaseNotes(autoConfirm: boolean): Promise<string> {
log.info("Update the root CHANGELOG.md with any additional changes.");
if (!(await verify("Continue with the release?"))) {
if (!(await verify("Continue with the release?", autoConfirm))) {
process.exit(1);
}

Expand Down Expand Up @@ -44,12 +44,12 @@ async function getCurrentReleaseNotes(): Promise<string> {
* @returns the current release markdown that can be used to generate a github
* release for the current tag.
*/
export async function initBlog(): Promise<string> {
export async function initBlog(autoConfirm: boolean): Promise<string> {
const blogPath = join(documentationRoot, src, "blogs", "index.md");
const version = (await getPackageJson("react-md")).version;
const blog = await readFile(blogPath, "utf-8");

const currentReleaseNotes = await getCurrentReleaseNotes();
const currentReleaseNotes = await getCurrentReleaseNotes(autoConfirm);
const blogMarkdown = currentReleaseNotes
// create smaller headings and remove margin
.replace(/^(###)\s+(.+)$/gm, "##### $2<!-- no-margin -->")
Expand Down

1 comment on commit dec09b8

@vercel
Copy link

@vercel vercel bot commented on dec09b8 Jul 27, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.