CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutSign UpSign In
sagemathinc

Real-time collaboration for Jupyter Notebooks, Linux Terminals, LaTeX, VS Code, R IDE, and more,
all in one place.

GitHub Repository: sagemathinc/cocalc
Path: blob/master/src/packages/next/lib/landing/executables.ts
Views: 687
1
/*
2
* This file is part of CoCalc: Copyright © 2021 Sagemath, Inc.
3
* License: MS-RSL – see LICENSE.md for details
4
*/
5
6
import { capitalize, field_cmp } from "@cocalc/util/misc";
7
import { splitFirst, splitLast } from "@cocalc/util/misc-path";
8
9
export interface Item {
10
name: string;
11
path: string;
12
output: string;
13
}
14
15
export default function executables(softwareSpec): Item[] {
16
const exes: Item[] = [];
17
for (const path in softwareSpec) {
18
const name = capitalize(splitFirst(splitLast(path, "/")[1], "-")[0]);
19
exes.push({
20
path,
21
output: softwareSpec[path],
22
name,
23
});
24
}
25
26
exes.sort(field_cmp("name"));
27
return exes;
28
}
29
30