Skip to content

Commit

Permalink
Update packages/cursorless-vscode/src/migrateSnippets.ts
Browse files Browse the repository at this point in the history
  • Loading branch information
phillco authored Jan 28, 2025
1 parent 1a85c84 commit 555028c
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion packages/cursorless-vscode/src/migrateSnippets.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,14 +60,18 @@ async function migrateFile(targetDirectory: string, filePath: string) {
try {
const destinationPath = path.join(targetDirectory, `${fileName}.snippet`);
await writeCommunityFile(communitySnippetFile, destinationPath);
} catch (_error) {
} catch (error: any) {
if (error.code === 'EEXIST') {
const destinationPath = path.join(
targetDirectory,
`${fileName}_CONFLICT.snippet`,
);
await writeCommunityFile(communitySnippetFile, destinationPath);
} else {
throw error;
}
}
}

function parseVariables(
variables?: Record<string, SnippetVariableLegacy>,
Expand Down

0 comments on commit 555028c

Please sign in to comment.