Skip to content

Commit

Permalink
Small updates to scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
RuiNtD committed Nov 10, 2023
1 parent 501ed2b commit f24221f
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 1 deletion.
1 change: 1 addition & 0 deletions deno.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

6 changes: 5 additions & 1 deletion fileinfo.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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})`);
3 changes: 3 additions & 0 deletions update.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`;
Expand Down

0 comments on commit f24221f

Please sign in to comment.