Fix initial artifact deployment and drift file replacement
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
import { getVersion, listScripts } from './scripts.js';
|
||||
|
||||
/** Published file artifacts shared by provisioning and drift reconciliation. */
|
||||
export function promotedArtifacts(game: string | null, map: string | null) {
|
||||
return (['script', 'plugin'] as const).flatMap((kind) =>
|
||||
listScripts(kind).flatMap((script) => {
|
||||
const scopeMatches = script.scope_type === 'game' ? script.scope_value === game
|
||||
: script.scope_type === 'map' ? script.scope_value === map : false;
|
||||
if (!scopeMatches || !script.current_version_id) return [];
|
||||
const version = getVersion(script.current_version_id);
|
||||
return version ? [{ kind, script, version }] : [];
|
||||
})
|
||||
);
|
||||
}
|
||||
Reference in New Issue
Block a user