1
0
mirror of https://github.com/laurent22/joplin.git synced 2024-12-24 10:27:10 +02:00

Chore: Fixes #9710: Default plugins build: Fetch when checkout fails (#9711)

Co-authored-by: Laurent Cozic <laurent22@users.noreply.github.com>
This commit is contained in:
Henry Heino 2024-01-18 03:22:39 -08:00 committed by GitHub
parent 4636d1539c
commit bdc970d718
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -47,7 +47,14 @@ const buildDefaultPlugins = async (outputParentDir: string|null, beforeInstall:
if (currentCommitHash !== expectedCommitHash) {
logStatus(`Switching to commit ${expectedCommitHash}`);
await execCommand(['git', 'switch', repositoryData.branch]);
await execCommand(['git', 'checkout', expectedCommitHash]);
try {
await execCommand(['git', 'checkout', expectedCommitHash]);
} catch (error) {
logStatus(`git checkout failed with error ${error}. Fetching...`);
await execCommand(['git', 'fetch']);
await execCommand(['git', 'checkout', expectedCommitHash]);
}
}
logStatus('Copying repository files...');