diff --git a/exts/imports/process_files.py b/exts/imports/process_files.py index bac47d1..86b67bf 100644 --- a/exts/imports/process_files.py +++ b/exts/imports/process_files.py @@ -122,3 +122,4 @@ def generate_files(storage_dir, ctx, filename, game_ini, dinos_data, mods): os.mkdir(directory) generate_game_ini(game_ini, mods, directory) generate_dino_files(dinos_data, directory) + return 1 diff --git a/exts/uploader.py b/exts/uploader.py index 2014f1f..baa1895 100644 --- a/exts/uploader.py +++ b/exts/uploader.py @@ -49,17 +49,20 @@ class Uploader: game_ini, dinos_data, mods) await msg.edit(content='Processing... Files generated... Committing changes') await utils.git_add(self.bot.loop, storage_dir, '*') - await utils.git_commit(self.bot.loop, - storage_dir, - f'Uploaded {len(dinos_data)} dinos {official}') - await msg.edit(content='Processing... Committed... Pushing files to GitHub') - push_status = await utils.git_push(self.bot.loop, storage_dir) - if push_status == 'Completed': - await msg.edit(content=f'{ctx.author.mention} Upload complete.') + if await utils.git_commit(self.bot.loop, + storage_dir, + f'"Uploaded {len(dinos_data)} dinos {official}"'): + await msg.edit(content='Processing... Committed... Pushing files to GitHub') + push_status = await utils.git_push(self.bot.loop, storage_dir) + if push_status == 'Completed': + await msg.edit(content=f'{ctx.author.mention} Upload complete.') + else: + await self.bot.get_user(owner_id).send(f'There was an error with git push' + f'\n{push_status}') + await msg.edit(content='There was an error pushing the files to GitHub\n' + 'Dusty.P has been notified and will get this fixed') else: - await self.bot.get_user(owner_id).send(f'There was an error with git push' - f'\n{push_status}') - await msg.edit(content='There was an error pushing the files to GitHub\n' + await msg.edit(content='There was an error committing the files\n' 'Dusty.P has been notified and will get this fixed') else: await self.bot.get_user(owner_id).send(f'There was an error with git pull\n'