mirror of
https://git.unlock-music.dev/um/um-react.git
synced 2024-11-23 22:02:19 +00:00
fix: pwsh script to dump db to current dir
This commit is contained in:
parent
b7859b68da
commit
0a012159ce
@ -1,11 +1,14 @@
|
|||||||
try {
|
try {
|
||||||
$gz_b64 = adb shell su -c "cat '{{ dir }}/{{ file }}' | gzip | base64" | Out-String
|
$gz_b64 = adb shell su -c "cat '{{ dir }}/{{ file }}' | gzip | base64" | Out-String
|
||||||
$bStream = New-Object System.IO.MemoryStream(,[System.Convert]::FromBase64String($gz_b64))
|
$bStream = New-Object System.IO.MemoryStream(,[System.Convert]::FromBase64String($gz_b64))
|
||||||
$decoded = New-Object System.IO.Compression.GzipStream($bStream, [System.IO.Compression.CompressionMode]::Decompress)
|
$decoded = New-Object System.IO.Compression.GzipStream($bStream, [System.IO.Compression.CompressionMode]::Decompress)
|
||||||
$outFile = New-Object System.IO.FileStream("{{ file }}", [System.IO.FileMode]::Create, [System.IO.FileAccess]::Write)
|
$outFile = New-Object System.IO.FileStream("${PWD}\{{ file }}", [System.IO.FileMode]::Create, [System.IO.FileAccess]::Write)
|
||||||
$decoded.CopyTo($outFile)
|
$decoded.CopyTo($outFile)
|
||||||
|
} catch {
|
||||||
|
Write-Host "遇到错误:"
|
||||||
|
Write-Host $_
|
||||||
} finally {
|
} finally {
|
||||||
if ($outFile -ne $null) { $outFile.Dispose() }
|
if ($outFile -ne $null) { $outFile.Dispose() }
|
||||||
if ($decoded -ne $null) { $decoded.Dispose() }
|
if ($decoded -ne $null) { $decoded.Dispose() }
|
||||||
if ($bStream -ne $null) { $bStream.Dispose() }
|
if ($bStream -ne $null) { $bStream.Dispose() }
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user