GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — t3code/scripts/clean-tsgo-backups.mjs at main · SivanTechDev/t3code

Expand file tree

/

clean-tsgo-backups.mjs

Copy path
More file actions
More file actions

Latest commit

 

History

History
History
24 lines (21 loc) · 1.01 KB
/

clean-tsgo-backups.mjs

Copy path

File metadata and controls

24 lines (21 loc) · 1.01 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
// Deletes stale tsgo backup files left behind by `effect-tsgo patch`.
//
// The patch command backs up the real tsgo binary to `tsgo.original`, and if
// that name is taken it writes `tsgo.original.1`, `.2`, ... without ever
// cleaning up. On runners that restore node_modules from a build cache
// (Vercel), backups accumulate across deploys until patch hard-fails at 101
// with "Too many backup files exist". Removing them is safe: from the second
// patch onward the backup is just the previously-patched binary, and pnpm
// restores the pristine one whenever the package is re-materialized.
//
// Runs as part of `prepare`, so it must only use node builtins.
import * as NodeFS from "node:fs";
const backups = NodeFS.globSync(
"node_modules/.pnpm/@typescript+native-preview-*/node_modules/@typescript/native-preview-*/lib/tsgo{,.exe}.original*",
);
for (const backup of backups) {
NodeFS.rmSync(backup, { force: true });
}
if (backups.length > 0) {
console.log(`Removed ${backups.length} stale tsgo backup(s)`);
}
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.