chore: 项目更名为 SceneMarshal
- README/脚本注释/LICENSE/图标文件名统一改名 - 右键菜单注册项改为 SceneMarshal / SceneMarshalArchive - media_archive 支持 SCENEMARSHAL_* 环境变量(保留旧变量兼容) - README 补充 preflight/字幕/字体/归档等实际能力与 check 用法
This commit is contained in:
+10
-10
@@ -1,7 +1,7 @@
|
||||
#Requires -Version 7.0
|
||||
<#
|
||||
.SYNOPSIS
|
||||
把本机 SceneRename 源码部署到 N100 的运行副本。
|
||||
把本机 SceneMarshal 源码部署到 N100 的运行副本。
|
||||
|
||||
.DESCRIPTION
|
||||
默认(源码同步):
|
||||
@@ -53,12 +53,12 @@ function Assert-Agent {
|
||||
}
|
||||
|
||||
function Invoke-RemoteScript([string]$Body) {
|
||||
$local = Join-Path ([IO.Path]::GetTempPath()) ("scenerename-remote-{0}.sh" -f [guid]::NewGuid().ToString('N').Substring(0, 8))
|
||||
$local = Join-Path ([IO.Path]::GetTempPath()) ("SceneMarshal-remote-{0}.sh" -f [guid]::NewGuid().ToString('N').Substring(0, 8))
|
||||
[IO.File]::WriteAllText($local, $Body, [Text.UTF8Encoding]::new($false))
|
||||
try {
|
||||
& scp @SshOpts -q $local "${Remote}:/tmp/scenerename-deploy.sh"
|
||||
& scp @SshOpts -q $local "${Remote}:/tmp/SceneMarshal-deploy.sh"
|
||||
if ($LASTEXITCODE -ne 0) { throw 'scp 上传远端脚本失败' }
|
||||
& ssh @SshOpts $Remote 'bash /tmp/scenerename-deploy.sh'
|
||||
& ssh @SshOpts $Remote 'bash /tmp/SceneMarshal-deploy.sh'
|
||||
if ($LASTEXITCODE -ne 0) { throw "远端脚本执行失败(exit $LASTEXITCODE)" }
|
||||
}
|
||||
finally {
|
||||
@@ -112,7 +112,7 @@ install_tool "$RemoteRepo/scripts/media_archive.py" /usr/local/bin/media-archive
|
||||
"@
|
||||
}
|
||||
else {
|
||||
$tgz = Join-Path ([IO.Path]::GetTempPath()) 'scenerename-sync.tgz'
|
||||
$tgz = Join-Path ([IO.Path]::GetTempPath()) 'SceneMarshal-sync.tgz'
|
||||
Write-Host '▶ 打包 media/src ...' -ForegroundColor Cyan
|
||||
if (Test-Path -LiteralPath $tgz) { Remove-Item -LiteralPath $tgz -Force }
|
||||
& tar -czf $tgz -C $RepoRoot --exclude=__pycache__ --exclude='*.pyc' media/src scripts
|
||||
@@ -120,7 +120,7 @@ install_tool "$RemoteRepo/scripts/media_archive.py" /usr/local/bin/media-archive
|
||||
Write-Host (" {0} KB" -f [math]::Round((Get-Item -LiteralPath $tgz).Length / 1KB, 1)) -ForegroundColor DarkGray
|
||||
|
||||
Write-Host '▶ 上传到 N100 ...' -ForegroundColor Cyan
|
||||
& scp @SshOpts -q $tgz "${Remote}:/tmp/scenerename-sync.tgz"
|
||||
& scp @SshOpts -q $tgz "${Remote}:/tmp/SceneMarshal-sync.tgz"
|
||||
if ($LASTEXITCODE -ne 0) { throw 'scp 上传失败' }
|
||||
|
||||
Invoke-RemoteScript @'
|
||||
@@ -128,9 +128,9 @@ set -euo pipefail
|
||||
REPO=/home/ali/docker/tools/python
|
||||
cd "$REPO"
|
||||
TS=$(date +%Y%m%d-%H%M%S)
|
||||
mkdir -p /tmp/scenerename-backup
|
||||
tar -czf "/tmp/scenerename-backup/src-$TS.tar.gz" media/src
|
||||
tar -xzf /tmp/scenerename-sync.tgz -C "$REPO"
|
||||
mkdir -p /tmp/SceneMarshal-backup
|
||||
tar -czf "/tmp/SceneMarshal-backup/src-$TS.tar.gz" media/src
|
||||
tar -xzf /tmp/SceneMarshal-sync.tgz -C "$REPO"
|
||||
find media/src -name '*.py' -exec chmod 644 {} +
|
||||
echo "=== 远端相对仓库 HEAD 的变更 ==="
|
||||
CHANGED=$(git status --porcelain -- media/src | head -40 || true)
|
||||
@@ -151,7 +151,7 @@ install_tool() {
|
||||
}
|
||||
install_tool "$REPO/scripts/media-rename" /usr/local/bin/media-rename
|
||||
install_tool "$REPO/scripts/media_archive.py" /usr/local/bin/media-archive
|
||||
echo "备份: /tmp/scenerename-backup/src-$TS.tar.gz"
|
||||
echo "备份: /tmp/SceneMarshal-backup/src-$TS.tar.gz"
|
||||
'@
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#Requires -Version 7.0
|
||||
<#
|
||||
.SYNOPSIS
|
||||
在 Windows 资源管理器右键菜单里注册 SceneRename 的「重命名」「归档」两项。
|
||||
在 Windows 资源管理器右键菜单里注册 SceneMarshal 的「重命名」「归档」两项。
|
||||
|
||||
.DESCRIPTION
|
||||
只写 HKCU(当前用户),不需要管理员权限,可随时用 uninstall-explorer-menu.ps1 移除。
|
||||
@@ -32,12 +32,12 @@ else {
|
||||
}
|
||||
|
||||
$repoRoot = Split-Path -Parent $PSScriptRoot
|
||||
$iconPath = Join-Path $repoRoot 'assets\scenerename.ico'
|
||||
$iconPath = Join-Path $repoRoot 'assets\SceneMarshal.ico'
|
||||
if (-not (Test-Path -LiteralPath $iconPath)) { $iconPath = $pwsh }
|
||||
|
||||
$actions = @(
|
||||
@{ Key = 'SceneRename'; Text = 'SceneRename 重命名'; Action = 'rename' },
|
||||
@{ Key = 'SceneRenameArchive'; Text = 'SceneRename 归档'; Action = 'archive' }
|
||||
@{ Key = 'SceneMarshal'; Text = 'SceneMarshal 重命名'; Action = 'rename' },
|
||||
@{ Key = 'SceneMarshalArchive'; Text = 'SceneMarshal 归档'; Action = 'archive' }
|
||||
)
|
||||
|
||||
$locations = @(
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
#!/usr/bin/env bash
|
||||
# media-rename —— 宿主机代理,把参数透传进 python 容器执行 SceneRename
|
||||
# media-rename —— 宿主机代理,把参数透传进 python 容器执行 SceneMarshal
|
||||
#
|
||||
# 用法:
|
||||
# media-rename # 处理当前目录
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
#Requires -Version 7.0
|
||||
<#
|
||||
.SYNOPSIS
|
||||
在 Windows 本机直接触发 N100 上的 media-rename(SceneRename 流水线)。
|
||||
在 Windows 本机直接触发 N100 上的 media-rename(SceneMarshal 流水线)。
|
||||
|
||||
.DESCRIPTION
|
||||
把本机的目标目录翻译成 N100 的 Linux 路径,再 `ssh -t` 调用服务端的
|
||||
|
||||
@@ -27,7 +27,7 @@ import urllib.request
|
||||
from pathlib import Path
|
||||
|
||||
def resolve_media_root(cfg: configparser.ConfigParser) -> Path:
|
||||
env = os.environ.get("SCENERENAME_MEDIA_ROOT")
|
||||
env = os.environ.get("SCENEMARSHAL_MEDIA_ROOT") or os.environ.get("SCENERENAME_MEDIA_ROOT")
|
||||
if env:
|
||||
return Path(env)
|
||||
raw = cfg.get("Archive", "media_root", fallback="").strip() if cfg.has_section("Archive") else ""
|
||||
|
||||
@@ -11,7 +11,7 @@ param()
|
||||
|
||||
$ErrorActionPreference = 'Stop'
|
||||
|
||||
$keyNames = @('SceneRename', 'SceneRenameArchive')
|
||||
$keyNames = @('SceneMarshal', 'SceneMarshalArchive')
|
||||
$shells = @(
|
||||
'HKCU:\Software\Classes\Directory\shell',
|
||||
'HKCU:\Software\Classes\Directory\Background\shell',
|
||||
|
||||
Reference in New Issue
Block a user