Skip to content

Commit

Permalink
feat(migrations): add migration script for removing none option for e…
Browse files Browse the repository at this point in the history
…mojis
  • Loading branch information
FlorianWoelki committed May 7, 2024
1 parent 1b096a0 commit 98b49ba
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/migrations/0004-remove-none-emoji-option.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
import IconFolderPlugin from '@app/main';

export default async function migrate(plugin: IconFolderPlugin): Promise<void> {
if (plugin.getSettings().migrated === 4) {
if ((plugin.getSettings().emojiStyle as string) === 'none') {
plugin.getSettings().emojiStyle = 'native';
}
plugin.getSettings().migrated++;
}
}
2 changes: 2 additions & 0 deletions src/migrations/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@ import IconFolderPlugin from '@app/main';
import migrate0001 from './0001-change-migrated-true-to-1';
import migrate0002 from './0002-order-custom-rules';
import migrate0003 from './0003-inheritance-to-custom-rule';
import migrate0004 from './0004-remove-none-emoji-option';

export const migrate = async (plugin: IconFolderPlugin): Promise<void> => {
// eslint-disable-next-line
Expand All @@ -14,6 +15,7 @@ export const migrate = async (plugin: IconFolderPlugin): Promise<void> => {
await migrate0001(plugin);
await migrate0002(plugin);
await migrate0003(plugin);
await migrate0004(plugin);

await plugin.saveIconFolderData();
};

0 comments on commit 98b49ba

Please sign in to comment.