Skip to content

Commit 0593693

Browse files
committed
fix: removal of readme file
1 parent f947703 commit 0593693

File tree

4 files changed

+68
-16
lines changed

4 files changed

+68
-16
lines changed

automation/utils/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
"enquirer": "^2.4.1",
4646
"execa": "^5.1.1",
4747
"fast-xml-parser": "^4.1.3",
48+
"glob": "^11.0.3",
4849
"node-fetch": "^2.7.0",
4950
"ora": "^5.4.1",
5051
"peggy": "^1.2.0",

automation/utils/src/changelog.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ export async function updateChangelogsAndCreatePR(
5757
const readmeossFile = findOssReadme(path, info.mxpackage.name, info.version.format());
5858
if (readmeossFile) {
5959
console.log(`Removing OSS clearance readme file '${readmeossFile}'...`);
60-
await exec(`git rm '${join(path, readmeossFile)}'`);
60+
await exec(`git rm '${readmeossFile}'`);
6161
}
6262

6363
await exec(`git commit -m "chore(${info.name}): update changelog"`);

automation/utils/src/oss-readme.ts

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,12 @@
1-
import { parse } from "path";
2-
import { find } from "./shell";
1+
import { globSync } from "glob";
32

43
export function findOssReadme(packageRoot: string, widgetName: string, version: string): string | undefined {
5-
const readmeossPattern = `*${widgetName}__${version}__READMEOSS_*.html`;
4+
const readmeossPattern = `**/*${widgetName}__${version}__READMEOSS_*.html`;
65

76
console.info(`Looking for READMEOSS file matching pattern: ${readmeossPattern}`);
87

9-
// Find files matching the pattern in package root
10-
const matchingFiles = find(packageRoot).filter(file => {
11-
const fileName = parse(file).base;
12-
// Check if filename contains the widget name, version, and READMEOSS
13-
return fileName.includes(`${widgetName}__${version}__READMEOSS_`) && fileName.endsWith(".html");
14-
});
8+
// Use glob to find files matching the pattern in package root
9+
const matchingFiles = globSync(readmeossPattern, { cwd: packageRoot, absolute: true, ignore: "**/dist/**" });
1510

1611
return matchingFiles[0];
1712
}

pnpm-lock.yaml

Lines changed: 62 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)