'use strict'; const {createSnapshot, publishSnapshot} = require('./core'); let snapshot; exports.throwError = true; exports.onBeforeBuild = async function(options) { snapshot = undefined; const scenePath = await Editor.Message.request('asset-db', 'query-path', options.startScene); snapshot = createSnapshot({projectPath: Editor.Project.path, scenePath, startScene: options.startScene}); }; exports.onAfterBuild = async function(options, result) { try { const destination = publishSnapshot(snapshot, options, result); console.log(`[youle-version-manifest] ${snapshot.gameKey}: ${destination}`); } finally { snapshot = undefined; } }; exports.onError = function() {snapshot = undefined;}; exports.unload = function() {snapshot = undefined;};