From be4c443836b8f8159fe62b04b785b7c77b73a46d Mon Sep 17 00:00:00 2001 From: DevilXD Date: Fri, 28 Jan 2022 23:07:53 +0100 Subject: [PATCH] Implement automatic zip dist creation --- .gitignore | 3 +++ .vscode/tasks.json | 9 +++++++++ build.bat | 3 +++ pack.bat | 13 +++++++++++++ 4 files changed, 28 insertions(+) create mode 100644 pack.bat diff --git a/.gitignore b/.gitignore index bcaad4e..867a702 100644 --- a/.gitignore +++ b/.gitignore @@ -5,6 +5,9 @@ __pycache__ /build /*.spec /Twitch Drops Miner +# Dist files +/7z.exe +/Twitch Drops Miner.zip # Dev files /cookies.jar /settings.json diff --git a/.vscode/tasks.json b/.vscode/tasks.json index 768010e..d39c127 100644 --- a/.vscode/tasks.json +++ b/.vscode/tasks.json @@ -15,6 +15,15 @@ "presentation": { "showReuseMessage": false } + }, + { + "label": "Pack App", + "type": "shell", + "command": "pack.bat", + "problemMatcher": [], + "presentation": { + "showReuseMessage": false + } } ] } diff --git a/build.bat b/build.bat index 7511da5..b123c89 100644 --- a/build.bat +++ b/build.bat @@ -1,2 +1,5 @@ +@echo off +cls pyinstaller --onefile --noconsole --name "Twitch Drops Miner (by DevilXD)" --icon pickaxe.ico ^ --add-data pickaxe.ico;. --distpath "./Twitch Drops Miner" main.py +call pack.bat diff --git a/pack.bat b/pack.bat new file mode 100644 index 0000000..804a4dc --- /dev/null +++ b/pack.bat @@ -0,0 +1,13 @@ +@echo off +IF NOT EXIST 7z.exe GOTO EXIT +IF NOT EXIST "Twitch Drops Miner.zip" GOTO NEW +7z u "Twitch Drops Miner.zip" "Twitch Drops Miner/" -r -x!"Twitch Drops Miner/cookies.*" +GOTO TEST +:NEW +7z a "Twitch Drops Miner.zip" "Twitch Drops Miner/" -r -x!"Twitch Drops Miner/cookies.*" +GOTO TEST +:TEST +7z t "Twitch Drops Miner.zip" +GOTO EXIT +:EXIT +exit %errorlevel%