Skip to content

Commit

Permalink
Adjust formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
fickevics-makor committed Sep 13, 2023
1 parent 3456cad commit 4d6f8e0
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions scripts/cps.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
} from "./constants";
import { getDocTag } from "./reusable";


// Fetch markdown files from Github
async function fetchReadmeContent(folderUrl: string): Promise<string | null> {
try {
Expand All @@ -32,18 +31,18 @@ async function fetchReadmeContent(folderUrl: string): Promise<string | null> {
}
}

// Update/Create CPS locally
// Update/Create CPS locally
async function updateOrCreateReadmeFile(
folderName: string,
content: string
): Promise<void> {
const title = getDocTag(content, "Title");
const cps = getDocTag(content, "CPS")
const cps = getDocTag(content, "CPS");
const sidebarLabel = `sidebar_label: "(${cps}) ${title}"`;
const status = getDocTag(content, "Status");
const creationDate = getDocTag(content, "Created");

// Sanitize title
// Sanitize title
const newContent = content.replace(
/Title: .+/,
`Title: "${title}"\n${sidebarLabel}${custom_edit_url}`
Expand Down

0 comments on commit 4d6f8e0

Please sign in to comment.