Skip to content
Source
Sign inSign up
Open History to see the last commit

tsgo

11 lines681 Bytes

1#!/bin/sh
2# VS Code's TypeScript 7 extension starts `<tsdk>/tsgo --lsp --stdio`. Exec Effect's patched tsrs
3# directly: through the effect-tsgo Node launcher, the LSP's stdin read intermittently fails (EAGAIN).
4exec "$(cd "$(dirname "$0")/../.." && node -e '
5const { createRequire } = require("node:module");
6const fs = require("node:fs");
7const path = require("node:path");
8const platform = `@effect/tsgo-${process.platform}-${process.arch}/package.json`;
9const dir = path.join(path.dirname(createRequire(require.resolve("@effect/tsgo/package.json")).resolve(platform)), "artifacts/tsrs");
10process.stdout.write(path.join(dir, fs.readdirSync(dir).sort().at(-1), "tsrs"));
11')" "$@"