Skip to content

Commit

Permalink
Fix regex
Browse files Browse the repository at this point in the history
  • Loading branch information
jessiehuff committed Mar 26, 2024
1 parent 254afed commit f6a7bd2
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions packages/class-name-updater/src/classNameUpdate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,12 +7,11 @@ import { printDiff } from "./printDiff";
export async function classNameUpdate(globTarget: string, makeChange: boolean, fileTypesRegex: RegExp, excludeFiles: string[] = [], pfVersion: number) {
const acceptedFileTypesRegex = fileTypesRegex || /\.(s?css|less|(t|j)sx?|md)$/;
// const changeNeededRegex = /(\b|\$)pf-([cul]|global|theme|color)-/g;
const previousVersion = pfVersion ? ("v" + (pfVersion - 1)) : ""
const previousVersion = pfVersion ? "-v" + (pfVersion - 1) : "";
const changeNeededRegex = new RegExp(
"(\b|\$)pf-" +
previousVersion +
"([cul]|global|theme|color)"
)
"(\\b|\\$)pf" + previousVersion + "-([cul]|global|theme|color)-",
"g"
);
const newVersion = pfVersion || 5

const files = sync(globTarget, { ignore: "**/node_modules/**" });
Expand Down

0 comments on commit f6a7bd2

Please sign in to comment.