mirror of
https://github.com/SabreTools/MPF.git
synced 2026-07-02 17:24:48 +00:00
Add cleanup to download functions
This commit is contained in:
@@ -15,6 +15,7 @@
|
||||
- Unify download maps
|
||||
- Trailing commas caused issues
|
||||
- Add initial extraction to new functions
|
||||
- Add cleanup to download functions
|
||||
|
||||
### 3.3.0 (2025-01-03)
|
||||
|
||||
|
||||
@@ -156,10 +156,21 @@ function download_programs() {
|
||||
done
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
#TEMP INVOCATION OF THE ABOVE
|
||||
download_programs
|
||||
# Clean up the downloaded files and directories
|
||||
for PREFIX in "${DL_PREFIXES[@]}"; do
|
||||
for RUNTIME in "${CHECK_RUNTIMES[@]}"; do
|
||||
URL=${DL_MAP["$PREFIX_$RUNTIME"]}
|
||||
if [ $URL = "" ]; then
|
||||
continue
|
||||
fi
|
||||
|
||||
EXT=${URL##*.}
|
||||
rm $PREFIX_$RUNTIME.$EXT
|
||||
rm -r $PREFIX_$RUNTIME-dir
|
||||
done
|
||||
done
|
||||
}
|
||||
|
||||
# Only build if requested
|
||||
if [ $NO_BUILD = false ]; then
|
||||
|
||||
@@ -143,6 +143,20 @@ function Download-Programs {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Clean up the downloaded files and directories
|
||||
foreach ($PREFIX in $DL_PREFIXES) {
|
||||
foreach ($RUNTIME in $CHECK_RUNTIMES) {
|
||||
$URL = $DL_MAP["$PREFIX_$RUNTIME"]
|
||||
if ( $URL -eq "" ) {
|
||||
continue
|
||||
}
|
||||
|
||||
$EXT=[System.IO.Path]::GetExtension($URL)
|
||||
Remove-Item -Path $PREFIX_$RUNTIME.$EXT
|
||||
Remove-Item -Path $PREFIX_$RUNTIME-dir -Recurse
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
# Only build if requested
|
||||
|
||||
Reference in New Issue
Block a user