diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js b/com.pdma.notion-timer.sdPlugin/bin/plugin.js index 2e7db12..a77ea86 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js @@ -6438,7 +6438,7 @@ async function stopTimer(token, entryId) { } // src/plugin.ts -var CURRENT_VERSION = "1.0.18"; +var CURRENT_VERSION = "1.0.19"; var GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master"; var SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= @@ -6474,9 +6474,10 @@ async function checkForUpdates(sendStatus) { return; } sendStatus?.(`Updating to v${version}\u2026`); + const PLUGIN_BASE = `${GITEA_BASE}/com.pdma.notion-timer.sdPlugin`; const [pluginResp, sigResp] = await Promise.all([ - fetchWithTimeout2(`${GITEA_BASE}/com.pdma.notion-timer.sdPlugin/bin/plugin.js`), - fetchWithTimeout2(`${GITEA_BASE}/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig`) + fetchWithTimeout2(`${PLUGIN_BASE}/bin/plugin.js`), + fetchWithTimeout2(`${PLUGIN_BASE}/bin/plugin.js.sig`) ]); if (!pluginResp.ok || !sigResp.ok) { sendStatus?.("Download failed"); @@ -6492,7 +6493,23 @@ async function checkForUpdates(sendStatus) { return; } const fs3 = await import("fs"); + const path5 = await import("path"); + const pluginRoot = path5.join(path5.dirname(__filename), ".."); + const ASSETS = [ + "ui/property-inspector.html", + "ui/global-property-inspector.html", + "imgs/idle.png", + "imgs/running.png" + ]; + const assetResps = await Promise.all(ASSETS.map((p) => fetchWithTimeout2(`${PLUGIN_BASE}/${p}`))); fs3.writeFileSync(__filename, newCode); + for (let i = 0; i < ASSETS.length; i++) { + if (!assetResps[i].ok) { + plugin_default.logger.warn(`Asset download failed: ${ASSETS[i]}`); + continue; + } + fs3.writeFileSync(path5.join(pluginRoot, ASSETS[i]), Buffer.from(await assetResps[i].arrayBuffer())); + } plugin_default.logger.info(`Updated to ${version}, restarting\u2026`); process.exit(0); } catch (err) { diff --git a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig index df7946a..7773024 100644 --- a/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig +++ b/com.pdma.notion-timer.sdPlugin/bin/plugin.js.sig @@ -1 +1,2 @@ -hÃj5±éÛù$r!¾ÿÙc•ÿðæd˜‚ÝÒ‘]ký“oÚl³ãö¸Ø¯˜iËÁHÃî©* ’ž;»ú˜ ×c  \ No newline at end of file +̬_0¥@±c8–q 4K7ó@%]¼¶Çxš”²Ô,d£1ôƒ.:0¾ÐeŸ +yÕbû—¿˜ÖKnc/ÁzŽ \ No newline at end of file diff --git a/notion-timer.streamDeckPlugin b/notion-timer.streamDeckPlugin index f98c054..fd3bf06 100644 Binary files a/notion-timer.streamDeckPlugin and b/notion-timer.streamDeckPlugin differ diff --git a/src/plugin.ts b/src/plugin.ts index d109ce6..15481e0 100644 --- a/src/plugin.ts +++ b/src/plugin.ts @@ -1,4 +1,4 @@ -const CURRENT_VERSION = "1.0.18"; +const CURRENT_VERSION = "1.0.19"; const GITEA_BASE = "https://gitea.pdmarf.co.uk/pdm/stream_deck_notion_timer/raw/branch/master"; const SIGNING_PUBLIC_KEY = `-----BEGIN PUBLIC KEY----- MCowBQYDK2VwAyEAN7ko8TUpuPzPAJuKAZCRjV0c4ZSlou5d9pUAF6o12b4= @@ -35,9 +35,10 @@ async function checkForUpdates(sendStatus?: (msg: string) => void): Promise void): Promise fetchWithTimeout(`${PLUGIN_BASE}/${p}`))); + fs.writeFileSync(__filename, newCode); + for (let i = 0; i < ASSETS.length; i++) { + if (!assetResps[i].ok) { streamDeck.logger.warn(`Asset download failed: ${ASSETS[i]}`); continue; } + fs.writeFileSync(path.join(pluginRoot, ASSETS[i]), Buffer.from(await assetResps[i].arrayBuffer())); + } + streamDeck.logger.info(`Updated to ${version}, restarting…`); process.exit(0); } catch (err) { diff --git a/version.json b/version.json index 09fae7f..bac3891 100644 --- a/version.json +++ b/version.json @@ -1 +1 @@ -{ "version": "1.0.18" } +{ "version": "1.0.19" }