Skip to content

Commit acc771a

Browse files
authored
fix(workflows): Do not throw error if github workflows directory does not exist when updating (#1383)
1 parent a63c920 commit acc771a

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

packages/core/update/Update.ts

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -208,10 +208,12 @@ function updateWorkflows(
208208

209209
for (const fileName of workflowFiles) {
210210
const workflowPath = `.github/workflows/${fileName}`;
211-
let workflow = fs.readFile(workflowPath);
212-
if (workflow) {
213-
workflow = workflow.replace(oldNpmInstall, newNpmInstall);
214-
fs.writeFile(workflowPath, workflow);
211+
if (fs.fileExists(workflowPath)) {
212+
let workflow = fs.readFile(workflowPath);
213+
if (workflow) {
214+
workflow = workflow.replace(oldNpmInstall, newNpmInstall);
215+
fs.writeFile(workflowPath, workflow);
216+
}
215217
}
216218
}
217219
}

0 commit comments

Comments
 (0)