Skip to content

Commit 5d8ff7b

Browse files
authored
Merge pull request #91 from sigmaSd/d
Don't require write permission on dry run
2 parents d96d0cb + a80d08c commit 5d8ff7b

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

mod.ts

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -139,10 +139,13 @@ export class Udd {
139139
return { initUrl, initVersion };
140140
}
141141

142-
await this.progress.log(`Attempting update: ${url.url} -> ${newVersion}`);
143-
const failed: boolean = await this.maybeReplace(url, newVersion, initUrl);
144-
const msg = failed ? "failed" : "successful";
145-
await this.progress.log(`Update ${msg}: ${url.url} -> ${newVersion}`);
142+
let failed = false;
143+
if (!this.options.dryRun) {
144+
await this.progress.log(`Attempting update: ${url.url} -> ${newVersion}`);
145+
failed = await this.maybeReplace(url, newVersion, initUrl);
146+
const msg = failed ? "failed" : "successful";
147+
await this.progress.log(`Update ${msg}: ${url.url} -> ${newVersion}`);
148+
}
146149
const maybeFragment = newFragmentToken === undefined
147150
? ""
148151
: `#${newFragmentToken}`;
@@ -164,7 +167,7 @@ export class Udd {
164167
await this.replace(initUrl, newUrl);
165168

166169
const failed = await this.test().then((_) => false).catch((_) => true);
167-
if (failed || this.options.dryRun) {
170+
if (failed) {
168171
await this.replace(newUrl, initUrl);
169172
}
170173
return failed;

0 commit comments

Comments
 (0)