1
0
mirror of https://git.tuxpa.in/a/code-server.git synced 2025-01-09 17:58:45 +00:00
code-server-2/src/node/app/bin.ts

29 lines
723 B
TypeScript
Raw Normal View History

import * as path from "path"
import { Application } from "../../common/api"
const getVscodeVersion = (): string => {
try {
return require(path.resolve(__dirname, "../../../lib/vscode/package.json")).version
} catch (error) {
return "unknown"
}
}
export const Vscode: Application = {
categories: ["Editor"],
installed: true,
name: "VS Code",
path: "/vscode",
version: getVscodeVersion(),
}
export const findApplications = async (): Promise<ReadonlyArray<Application>> => {
const apps: Application[] = [Vscode]
return apps.sort((a, b): number => a.name.localeCompare(b.name))
}
export const findWhitelistedApplications = async (): Promise<ReadonlyArray<Application>> => {
return [Vscode]
}