Skip to content

Commit

Permalink
fix: non existent file
Browse files Browse the repository at this point in the history
  • Loading branch information
maxprilutskiy committed Nov 17, 2024
1 parent 3a8b947 commit 660ddb2
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions action/src/flows/pull-request.ts
Original file line number Diff line number Diff line change
Expand Up @@ -147,8 +147,14 @@ export class PullRequestFlow extends InBranchFlow {
targetFiles.push(...targetFileNames);
execSync(`git fetch origin ${this.i18nBranchName}`, { stdio: 'inherit' });
for (const file of targetFiles) {
// bring all files to the i18n branch'es state
execSync(`git checkout FETCH_HEAD -- ${file}`, { stdio: 'inherit' });
try {
// bring all files to the i18n branch's state
execSync(`git checkout FETCH_HEAD -- ${file}`, { stdio: 'inherit' });
} catch (error) {
// If file doesn't exist in FETCH_HEAD, that's okay - just skip it
this.ora.warn(`Skipping non-existent file: ${file}`);
continue;
}
}
this.ora.succeed('Restored target files');
}
Expand Down

0 comments on commit 660ddb2

Please sign in to comment.