Fix double rename
This commit is contained in:
parent
0906d053a5
commit
2552334b61
Plugins
|
@ -41,7 +41,7 @@ var XenoLib = (() => {
|
|||
twitter_username: ''
|
||||
}
|
||||
],
|
||||
version: '1.2.1',
|
||||
version: '1.2.2',
|
||||
description: 'Simple library to complement plugins with shared code without lowering performance.',
|
||||
github: 'https://github.com/1Lighty',
|
||||
github_raw: 'https://raw.githubusercontent.com/1Lighty/BetterDiscordPlugins/master/Plugins/1XenoLib.plugin.js'
|
||||
|
@ -568,7 +568,7 @@ var XenoLib = (() => {
|
|||
fs.accessSync(currentName, fs.constants.W_OK | fs.constants.R_OK);
|
||||
const files = fs.readdirSync(pluginsFolder);
|
||||
files.forEach(file => {
|
||||
if (!file.startsWith(pluginName) || file.indexOf('.plugin.js') !== -1) return;
|
||||
if (!file.startsWith(pluginName) || file.startsWith(newName) || file.indexOf('.plugin.js') !== -1) return;
|
||||
fs.renameSync(path.resolve(pluginsFolder, file), path.resolve(pluginsFolder, `${newName}${file.match(new RegExp(`^${pluginName}(.*)`))[1]}`));
|
||||
});
|
||||
fs.renameSync(currentName, path.resolve(pluginsFolder, `${newName}.plugin.js`));
|
||||
|
|
Loading…
Reference in New Issue