diff --git a/.gitignore b/.gitignore index ae5101c..3e4a3a3 100644 --- a/.gitignore +++ b/.gitignore @@ -3,3 +3,4 @@ node_modules __pycache__ *.pyc docker +**/dl-downer-bundle.zip diff --git a/dl-downer/scripts/bundle.ps1 b/dl-downer/scripts/bundle.ps1 new file mode 100644 index 0000000..5bd47ca --- /dev/null +++ b/dl-downer/scripts/bundle.ps1 @@ -0,0 +1,24 @@ +$bundleName = "./dl-downer-bundle.zip" +$root = Resolve-Path "$PSScriptRoot/.." +Set-Location $root + +if (Test-Path $bundleName) { + $answer = Read-Host "$bundleName already exists. Overwrite? (y/n)" + if ($answer -ne 'y') { + Write-Host "Aborted." + exit 1 + } + Remove-Item $bundleName +} + +# Check if Compress-Archive is available (PowerShell 5+) +if (Get-Command Compress-Archive -ErrorAction SilentlyContinue) { + # Remove __pycache__ folders temporarily + $exclude = Get-ChildItem -Path .\src -Recurse -Directory -Filter "__pycache__" + foreach ($dir in $exclude) { Remove-Item $dir.FullName -Recurse -Force } + Compress-Archive -Path cli.py,src -DestinationPath $bundleName + Write-Host "Created $bundleName" +} else { + Write-Host "Compress-Archive not available. Please use a zip tool manually." + exit 1 +} diff --git a/dl-downer/scripts/bundle.sh b/dl-downer/scripts/bundle.sh new file mode 100644 index 0000000..3d58c03 --- /dev/null +++ b/dl-downer/scripts/bundle.sh @@ -0,0 +1,17 @@ +#!/bin/sh +BUNDLE_NAME="./dl-downer-bundle.zip" + +cd "$(dirname "$0")/.." + +if [ -f "$BUNDLE_NAME" ]; then + echo "$BUNDLE_NAME already exists. Overwrite? (y/n)" + read answer + if [ "$answer" != "y" ]; then + echo "Aborted." + exit 1 + fi + rm "$BUNDLE_NAME" +fi + +zip -r "$BUNDLE_NAME" cli.py src -x "*/__pycache__/*" +echo "Created $BUNDLE_NAME"