diff --git a/deno.lock b/deno.lock index 878f1f5..dd94804 100644 --- a/deno.lock +++ b/deno.lock @@ -287,6 +287,7 @@ "https://deno.land/std@0.196.0/path/posix.ts": "8b7c67ac338714b30c816079303d0285dd24af6b284f7ad63da5b27372a2c94d", "https://deno.land/std@0.196.0/path/separator.ts": "0fb679739d0d1d7bf45b68dacfb4ec7563597a902edbaf3c59b50d5bcadd93b1", "https://deno.land/std@0.196.0/path/win32.ts": "4fca292f8d116fd6d62f243b8a61bd3d6835a9f0ede762ba5c01afe7c3c0aa12", + "https://deno.land/std@0.200.0/permissions/mod.ts#=": "9c879d5be6e3638fc36a0e855a8d0582cf9674cc68fb6775f4d3522d93127264", "https://deno.land/std@0.201.0/assert/assert.ts": "9a97dad6d98c238938e7540736b826440ad8c1c1e54430ca4c4e623e585607ee", "https://deno.land/std@0.201.0/assert/assertion_error.ts": "4d0bde9b374dfbcbe8ac23f54f567b77024fb67dbb1906a852d67fe050d42f56", "https://deno.land/std@0.201.0/bytes/copy.ts": "939d89e302a9761dcf1d9c937c7711174ed74c59eef40a1e4569a05c9de88219", diff --git a/fileinfo.ts b/fileinfo.ts index 7ff046c..b0477d8 100644 --- a/fileinfo.ts +++ b/fileinfo.ts @@ -36,6 +36,11 @@ const hash = encodeHex( ); const tempDir = $.path(await Deno.makeTempDir()); +for (const type of ["unload", "unhandledrejection"]) + globalThis.addEventListener(type, () => { + tempDir.removeSync({ recursive: true }); + }); + await $`${file} /DESTINATION=${tempDir}\\`; let tempSize = 0; @@ -45,7 +50,6 @@ for await (const entry of tempDir.walk()) { tempSize += stat?.size || 0; } const installedSize = formatSize(tempSize); -await tempDir.remove({ recursive: true }); $.log(`[${downloadSize} download / ${installedSize} installed] (MD5: ${hash})`); diff --git a/update.ts b/update.ts index 00f7949..c70a7fb 100644 --- a/update.ts +++ b/update.ts @@ -38,6 +38,9 @@ const versionArray = appinfo.Version.PackageVersion.split("."); const currentVersion = versionArray.slice(0, 2).join("."); const updateAvailable = currentVersion != latestVersion; +$.log( + `Old version: ${appinfo.Version.DisplayVersion} (${appinfo.Version.PackageVersion})` +); const updateNum = updateAvailable ? 0 : parseInt(versionArray[2]) + 1; appinfo.Version.DisplayVersion = `${latestVersion} Update ${updateNum}`; appinfo.Version.PackageVersion = `${latestVersion}.${updateNum}.0`;