@praise166/vire 0.1.6 → 0.1.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/dist/vire.js +14 -12
  2. package/package.json +2 -2
package/dist/vire.js CHANGED
@@ -214,20 +214,19 @@ async function checkForUpdate(status) {
214
214
  return null;
215
215
  }
216
216
  if (!remoteBuild) {
217
- return downloadRuntime(status.download_url, 'latest');
217
+ return downloadRuntime(status.download_url, 'latest', true);
218
218
  }
219
219
  if (remoteBuild === currentBuild) {
220
- const existing = await downloadedRuntimePath(remoteBuild);
220
+ return downloadRuntime(status.download_url, remoteBuild, true);
221
+ }
222
+ return downloadRuntime(status.download_url, remoteBuild, true);
223
+ }
224
+ async function downloadRuntime(url, build, refresh = false) {
225
+ if (!refresh) {
226
+ const existing = await downloadedRuntimePath(build);
221
227
  if (existing)
222
228
  return existing;
223
- return downloadRuntime(status.download_url, remoteBuild);
224
229
  }
225
- return downloadRuntime(status.download_url, remoteBuild);
226
- }
227
- async function downloadRuntime(url, build) {
228
- const existing = await downloadedRuntimePath(build);
229
- if (existing)
230
- return existing;
231
230
  if (!url) {
232
231
  return null;
233
232
  }
@@ -402,15 +401,18 @@ async function saveSession(token, user) {
402
401
  async function ensureReleaseBinary(downloadedRuntime) {
403
402
  if (downloadedRuntime)
404
403
  return downloadedRuntime;
405
- const updateBinary = await newestDownloadedRuntime();
406
- if (updateBinary)
407
- return updateBinary;
408
404
  const exe = process.platform === 'win32' ? 'vire.exe' : 'vire';
409
405
  const binary = join(root, 'target', 'release', exe);
410
406
  let exists = true;
411
407
  await access(binary).catch(() => {
412
408
  exists = false;
413
409
  });
410
+ if (exists && process.env.VIRE_USE_LOCAL_RUNTIME === 'true') {
411
+ return binary;
412
+ }
413
+ const updateBinary = await newestDownloadedRuntime();
414
+ if (updateBinary)
415
+ return updateBinary;
414
416
  if (!exists) {
415
417
  throw new Error('runtime missing; upload the exe to r2 or place it in updates');
416
418
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@praise166/vire",
3
- "version": "0.1.6",
3
+ "version": "0.1.8",
4
4
  "private": false,
5
5
  "type": "module",
6
6
  "bin": {
@@ -8,7 +8,7 @@
8
8
  "vire.self": "./dist/vire.js"
9
9
  },
10
10
  "vire": {
11
- "statusUrl": "https://vire-self-status.your-subdomain.workers.dev"
11
+ "statusUrl": "https://seo.manipu.lat"
12
12
  },
13
13
  "scripts": {
14
14
  "dev": "tsx cli/vire.ts",