2020-02-13 22:38:05 +00:00
|
|
|
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"],
|
2020-02-18 22:51:55 +00:00
|
|
|
installed: true,
|
2020-02-13 22:38:05 +00:00
|
|
|
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>> => {
|
2020-02-18 22:51:55 +00:00
|
|
|
return [Vscode]
|
2020-02-13 22:38:05 +00:00
|
|
|
}
|