Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@ node_modules
__pycache__
*.pyc
docker
**/dl-downer-bundle.zip
24 changes: 24 additions & 0 deletions dl-downer/scripts/bundle.ps1
Original file line number Diff line number Diff line change
@@ -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
Comment thread
BelgianNoise marked this conversation as resolved.
Write-Host "Created $bundleName"
} else {
Write-Host "Compress-Archive not available. Please use a zip tool manually."
exit 1
}
17 changes: 17 additions & 0 deletions dl-downer/scripts/bundle.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
#!/bin/sh
BUNDLE_NAME="./dl-downer-bundle.zip"

cd "$(dirname "$0")/.."
Comment thread
BelgianNoise marked this conversation as resolved.

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"