Skip to content

Commit db3ab51

Browse files
committed
feat: codium sandbox setup cmd (wip)
1 parent 0c0cebb commit db3ab51

File tree

4 files changed

+48
-1
lines changed

4 files changed

+48
-1
lines changed

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
"fix:meta": "pnpm run meta-updater:base && pnpm -r exec prettier --write tsconfig.json package.json",
1818
"fix:syncpack": "pnpm syncpack fix-mismatches",
1919
"init-vscode-sandbox": "pnpm --filter=@cursorless/cursorless-vscode init-launch-sandbox",
20+
"init-codium-sandbox": "pnpm --filter=@cursorless/cursorless-vscode init-launch-sandbox-codium",
2021
"lint:meta": "pnpm run meta-updater:base --test",
2122
"lint:ts": "cross-env ESLINT_USE_FLAT_CONFIG=false eslint packages --ext ts,tsx,mts",
2223
"lint": "pnpm run lint:meta && syncpack list-mismatches && pnpm run lint:ts",

packages/common/src/extensionDependencies.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ export const extensionDependencies = [
55
// Register necessary language-IDs for tests
66
"scala-lang.scala", // scala
77
"mrob95.vscode-talonscript", // talon
8-
"jrieken.vscode-tree-sitter-query", // scm
8+
//"jrieken.vscode-tree-sitter-query", // scm TODO: UNDO THIS WHEN PUBLISHED TO OPENVSX
99
"mathiasfrohlich.kotlin", // kotlin
1010

1111
// Necessary for the `drink cell` and `pour cell` tests

packages/cursorless-vscode/package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1248,6 +1248,7 @@
12481248
"esbuild:meta": "pnpm run esbuild:base --metafile=meta.json",
12491249
"populate-dist": "my-ts-node ./src/scripts/populateDist/index.ts",
12501250
"init-launch-sandbox": "my-ts-node src/scripts/initLaunchSandbox.ts",
1251+
"init-launch-sandbox-codium": "my-ts-node src/scripts/initLaunchSandboxCodium.ts",
12511252
"preprocess-svg-hats": "my-ts-node src/scripts/preprocessSvgHats.ts",
12521253
"hat-adjustment-add": "my-ts-node src/scripts/hatAdjustments/add.ts",
12531254
"hat-adjustment-average": "my-ts-node src/scripts/hatAdjustments/average.ts",
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
/**
2+
* A clone of initLaunchSandbox.ts for VSCodium setup (as the command codium is used instead of code)
3+
*/
4+
import { extensionDependencies } from "@cursorless/common";
5+
import * as cp from "child_process";
6+
7+
const extraExtensions = ["pokey.command-server"];
8+
9+
async function main() {
10+
try {
11+
const args = [
12+
"--profile=cursorlessDevelopment",
13+
...[...extensionDependencies, ...extraExtensions].flatMap(
14+
(dependency) => ["--install-extension", dependency],
15+
),
16+
];
17+
18+
if (process.argv.includes("--force")) {
19+
args.push("--force");
20+
}
21+
22+
// Install extension dependencies
23+
const subprocess = cp.spawn("codium", args, {
24+
stdio: "inherit",
25+
shell: true,
26+
});
27+
28+
await new Promise<void>((resolve, reject) => {
29+
subprocess.on("error", reject);
30+
subprocess.on("exit", (codium) => {
31+
if (codium === 0) {
32+
resolve();
33+
} else {
34+
reject(new Error(`Process returned code ${codium}`));
35+
}
36+
});
37+
});
38+
} catch (err) {
39+
console.error("Failed to init launch sandbox");
40+
console.error(err);
41+
process.exit(1);
42+
}
43+
}
44+
45+
void main();

0 commit comments

Comments
 (0)