upload gif to documentation
This commit is contained in:
parent
3ffc6c468d
commit
4893479f28
|
@ -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
|
||||
|
||||

|
||||

|
||||
|
||||
> 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 |
2
main.ts
2
main.ts
|
@ -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();
|
||||
});
|
||||
});
|
||||
|
|
|
@ -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');
|
||||
};
|
||||
|
|
|
@ -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(
|
||||
|
|
Loading…
Reference in New Issue