Add README and mmap restore script (chunked release backup)
This commit is contained in:
commit
b2ebad564e
23
README.md
Normal file
23
README.md
Normal file
@ -0,0 +1,23 @@
|
|||||||
|
# newmindjet
|
||||||
|
|
||||||
|
MindManager 导图仓库(托管于 git.nomadro.cn)。
|
||||||
|
|
||||||
|
## 当前文件
|
||||||
|
|
||||||
|
完整 `nomad_27 copy.mmap`(约 37MB)因服务器 nginx 上传限制无法直接 `git push`,已拆成 75 个分片放在 Release:
|
||||||
|
|
||||||
|
- https://git.nomadro.cn/hackrobot/newmindjet/releases/tag/mmap-current
|
||||||
|
|
||||||
|
## 还原 mmap
|
||||||
|
|
||||||
|
在仓库根目录执行:
|
||||||
|
|
||||||
|
```powershell
|
||||||
|
powershell -ExecutionPolicy Bypass -File .\restore-mmap.ps1
|
||||||
|
```
|
||||||
|
|
||||||
|
会下载全部分片并合并为 `nomad_27 copy.mmap`。
|
||||||
|
|
||||||
|
## 完整历史
|
||||||
|
|
||||||
|
本地仍保留完整 git 历史。待服务器放开 `client_max_body_size`(建议 512m)后即可推送全部 commits。
|
||||||
36
restore-mmap.ps1
Normal file
36
restore-mmap.ps1
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
# Restores "nomad_27 copy.mmap" from Release mmap-current assets.
|
||||||
|
$ErrorActionPreference = "Stop"
|
||||||
|
$owner = "hackrobot"
|
||||||
|
$repo = "newmindjet"
|
||||||
|
$tag = "mmap-current"
|
||||||
|
$outFile = Join-Path $PSScriptRoot "nomad_27 copy.mmap"
|
||||||
|
$api = "https://git.nomadro.cn/api/v1/repos/$owner/$repo/releases/tags/$tag"
|
||||||
|
|
||||||
|
Write-Host "Fetching release $tag ..."
|
||||||
|
$rel = Invoke-RestMethod -Uri $api -Method Get
|
||||||
|
$assets = $rel.assets | Sort-Object name
|
||||||
|
if (-not $assets -or $assets.Count -eq 0) { throw "No assets found on release $tag" }
|
||||||
|
|
||||||
|
$tmp = Join-Path $env:TEMP ("mmap-restore-" + [guid]::NewGuid().ToString("n"))
|
||||||
|
New-Item -ItemType Directory -Path $tmp | Out-Null
|
||||||
|
try {
|
||||||
|
$i = 0
|
||||||
|
foreach ($a in $assets) {
|
||||||
|
$i++
|
||||||
|
$dest = Join-Path $tmp $a.name
|
||||||
|
Write-Host "[$i/$($assets.Count)] $($a.name) ($($a.size) bytes)"
|
||||||
|
Invoke-WebRequest -Uri $a.browser_download_url -OutFile $dest -UseBasicParsing
|
||||||
|
}
|
||||||
|
if (Test-Path $outFile) { Remove-Item $outFile -Force }
|
||||||
|
$parts = Get-ChildItem $tmp -File | Sort-Object Name
|
||||||
|
$fs = [IO.File]::Create($outFile)
|
||||||
|
try {
|
||||||
|
foreach ($p in $parts) {
|
||||||
|
$bytes = [IO.File]::ReadAllBytes($p.FullName)
|
||||||
|
$fs.Write($bytes, 0, $bytes.Length)
|
||||||
|
}
|
||||||
|
} finally { $fs.Close() }
|
||||||
|
Write-Host "Wrote $outFile ($((Get-Item $outFile).Length) bytes)"
|
||||||
|
} finally {
|
||||||
|
Remove-Item $tmp -Recurse -Force -ErrorAction SilentlyContinue
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue
Block a user