upload gif to documentation

This commit is contained in:
Oleg 2022-08-28 14:49:29 +03:00
parent 3ffc6c468d
commit 4893479f28
5 changed files with 4 additions and 5 deletions

View File

@ -8,7 +8,7 @@
This plugin was developed to cover my initial needs and rename a bunch of files and update their reference in code base respectively. So now you can rename a bunch of files from the directory and all imports also will be updated in a code-base
![img.png](documentation/assets/img.png)
![](documentation/assets/Animation.gif)
> Under the hood this plugin is using obsidian API for renaming, but we just applying it for many files

Binary file not shown.

After

Width:  |  Height:  |  Size: 14 MiB

View File

@ -193,7 +193,7 @@ class BulkRenameSettingsTab extends PluginSettingTab {
button.setButtonText('Rename');
button.onClick(async () => {
button.setDisabled(true);
renameFilesInObsidian(this.app, this.plugin);
await renameFilesInObsidian(this.app, this.plugin);
this.display();
});
});

View File

@ -65,7 +65,7 @@ export const replaceFilePath = (plugin: BulkRenamePlugin, file: TFile) => {
return `${newPath}.${file.extension}`;
};
export const renameFilesInObsidian = (app: App, plugin: BulkRenamePlugin) => {
export const renameFilesInObsidian = async (app: App, plugin: BulkRenamePlugin) => {
const { replacePattern, existingSymbol } = plugin.settings;
if (!existingSymbol) {
@ -85,7 +85,7 @@ export const renameFilesInObsidian = (app: App, plugin: BulkRenamePlugin) => {
new Notice('renaming has been started');
for (const fileName of plugin.settings.fileNames) {
app.fileManager.renameFile(fileName, replaceFilePath(plugin, fileName));
await app.fileManager.renameFile(fileName, replaceFilePath(plugin, fileName));
}
new Notice('successfully renamed all files');
};

View File

@ -9,7 +9,6 @@ describe('File Services', () => {
it.todo('should display notification after renaming');
});
describe('Validation', () => {
it.todo('should display notification if there an error');
it.todo('should display notification if there an error');
it.todo("should display notification if Existing Symbol doesn't exists");
it.todo(