chore: 初始化仓库,导入项目基线代码
Academy v0.8.3 完整代码基线:Go 后端(internal/cmd/cli/mcp-server/docreader)、 Vue 前端(frontend)、数据库迁移(migrations)、部署编排(docker/helm/deploy)与文档。 今日开发的培训推送管理改动随后单独提交。
This commit is contained in:
commit
7ec21f35b0
5767 files changed
+1436788
No files matched your search
@@ -0,0 +1,27 @@
|
||||
import assert from 'node:assert/strict';
|
||||
import { mkdtempSync, mkdirSync, readFileSync, rmSync, writeFileSync } from 'node:fs';
|
||||
import { tmpdir } from 'node:os';
|
||||
import { join } from 'node:path';
|
||||
import { test } from 'node:test';
|
||||
import { syncProductScreenshots } from './sync-product-screenshots.mjs';
|
||||
|
||||
test('refreshes changed source images and aliases without replacing homepage-only assets', t => {
|
||||
const root = mkdtempSync(join(tmpdir(), 'academy-shots-'));
|
||||
t.after(() => rmSync(root, { recursive: true, force: true }));
|
||||
const source = join(root, 'source');
|
||||
const destination = join(root, 'product');
|
||||
mkdirSync(source);
|
||||
mkdirSync(destination);
|
||||
writeFileSync(join(source, 'wiki-graph-groups.png'), 'new graph');
|
||||
writeFileSync(join(source, 'sandbox-panel-terminal.png'), 'new terminal');
|
||||
writeFileSync(join(destination, 'wiki-graph-groups.png'), 'old graph');
|
||||
writeFileSync(join(destination, 'sandbox-terminal.png'), 'old terminal');
|
||||
writeFileSync(join(destination, 'homepage-only.png'), 'keep this');
|
||||
assert.equal(syncProductScreenshots(source, destination), 2);
|
||||
assert.equal(readFileSync(join(destination, 'wiki-graph-groups.png'), 'utf8'), 'new graph');
|
||||
assert.equal(readFileSync(join(destination, 'sandbox-terminal.png'), 'utf8'), 'new terminal');
|
||||
assert.equal(readFileSync(join(destination, 'homepage-only.png'), 'utf8'), 'keep this');
|
||||
writeFileSync(join(source, 'wiki-graph-groups.png'), 'updated graph again');
|
||||
syncProductScreenshots(source, destination);
|
||||
assert.equal(readFileSync(join(destination, 'wiki-graph-groups.png'), 'utf8'), 'updated graph again');
|
||||
});
|
||||
Reference in new issue
Block a user