Skip to content

Commit

Permalink
fix: hosted dependency version regex (#262)
Browse files Browse the repository at this point in the history
  • Loading branch information
ekasetiawans authored Mar 22, 2022
1 parent 2dde9ee commit b6e1bf4
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/melos/lib/src/package.dart
Original file line number Diff line number Diff line change
Expand Up @@ -105,10 +105,10 @@ RegExp dependencyVersionReplaceRegex(String dependencyName) {
);
}

// https://regex101.com/r/ob8xRv/1
// https://regex101.com/r/HIeQaI/1
RegExp hostedDependencyVersionReplaceRegex(String dependencyName) {
return RegExp(
'''(^[ \t]*?(?<dependency>$dependencyName)[ \\t]*?:[ \\t]*?[\\s\\S]*?[ \\t]*?version:[ \\t]*?)(?<version>any|["'^<>=]*\\d\\.\\d\\.\\d['"._ \\t<>=\\d-\\w+]*|\$)\$''',
'''(^[ \t]*?(?<dependency>$dependencyName)[ \\t]*?:[ \\t]*?[\\s\\S]*?[ \\t]*?version:[ \\t]*?)(?<version>any|\\^.*|["'^<>=]*\\d\\.\\d\\.\\d['"._ \\t<>=\\d-\\w+]*|\$)\$''',
multiLine: true,
);
}
Expand Down

0 comments on commit b6e1bf4

Please sign in to comment.