mirror of
https://github.com/smogon/sprites.git
synced 2026-09-14 21:16:11 -05:00
Drop the last vestiges of the __key convention
The upload command names the asset set on its command line now. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This commit is contained in:
@@ -18,8 +18,7 @@ export interface SrcFile extends pathlib.Path {
|
||||
export type CopySource = Artifact | SrcFile | string; // string = repo-relative path
|
||||
|
||||
// The finish API: nice naming over built artifacts and raw sources. Ops are
|
||||
// queued in call order (the tar entry order), so __key-style entries must be
|
||||
// written first.
|
||||
// queued in call order, which is the tar entry order.
|
||||
export interface DeployCtx {
|
||||
copy(src : CopySource, dst : string) : void;
|
||||
write(dst : string, data : string) : void;
|
||||
|
||||
@@ -65,11 +65,11 @@ test('ctx queues artifact copies from the CAS, writes and reads', () => {
|
||||
const artifact = makeArtifact(casDir, 'bytes', 'webp');
|
||||
const aq = new ActionQueue();
|
||||
const ctx = makeCtx(casDir, aq);
|
||||
ctx.write('__key', 'sprites');
|
||||
ctx.write('m.json', '{}');
|
||||
ctx.copy(artifact, 'sprites/x.webp');
|
||||
assert.equal(ctx.read(artifact), 'bytes');
|
||||
const ops = aq.log.filter(e => e.type === 'Op');
|
||||
assert.deepEqual(ops.map(e => e.dst), ['__key', 'sprites/x.webp']);
|
||||
assert.deepEqual(ops.map(e => e.dst), ['m.json', 'sprites/x.webp']);
|
||||
assert.equal((ops[1] as {op : {src : string}}).op.src, casPath(casDir, artifact.hash, 'webp'));
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user