Skip to content

Instantly share code, notes, and snippets.

@ryan-nauman
Created February 1, 2024 18:55
Show Gist options
  • Save ryan-nauman/63c30b1e9aa59619ae1c3b84a14a83dc to your computer and use it in GitHub Desktop.
Save ryan-nauman/63c30b1e9aa59619ae1c3b84a14a83dc to your computer and use it in GitHub Desktop.
script kit open project in vscode
// Name: Open Project
import '@johnlindquist/kit';
import { Dirent } from 'fs';
export type ScriptDir = Dirent & { path: string };
let dir1 = await readdir(home('git/studiox'), { withFileTypes: true });
let dir2 = await readdir(home('git/public'), { withFileTypes: true });
let dirs = [...dir1, ...dir2]
.filter((dir) => dir.isDirectory())
.map((dir: ScriptDir) => `${dir.path}/${dir.name}`);
let selectedDir = await arg(
'Open Project:',
dirs.map((dir) => ({
name: dir,
description: home('git', dir),
value: home('git', dir),
})),
);
edit(selectedDir);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment