Skip to content

Commit 0588490

Browse files
authored
fix: maintain dep version constraint kind (#47)
1 parent eff597a commit 0588490

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crate.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ export class Crate {
9999
"gm",
100100
);
101101

102-
const newText = originalText.replace(findRegex, `$1"${version}"`);
102+
const newText = originalText.replace(findRegex, `$1"$2${version}"`);
103103
if (originalText !== newText) {
104104
rootpath.writeTextSync(newText);
105105
} else {
@@ -136,7 +136,7 @@ export class Crate {
136136
`^(\\b${dependencyName}\\b\\s.*)"([=\\^])?[0-9]+[^"]+"`,
137137
"gm",
138138
);
139-
return fileText.replace(findRegex, `$1"${version}"`);
139+
return fileText.replace(findRegex, `$1"$2${version}"`);
140140
});
141141

142142
dependency.req = `^${version}`;

0 commit comments

Comments
 (0)