-
-
Notifications
You must be signed in to change notification settings - Fork 201
Expand file tree
/
Copy pathmarkdown.ts
More file actions
55 lines (51 loc) · 1.58 KB
/
markdown.ts
File metadata and controls
55 lines (51 loc) · 1.58 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
import { green } from "ansi-colors";
import { details, IRequirementResult, RequirementDetails } from "..";
export function printResults(data: {
results: IRequirementResult[];
details: RequirementDetails;
}) {
const asYamlList = (list: string[]) => {
if (Array.isArray(list)) {
return "\n" + list.map((item: string) => ` - ${item}`).join("\n");
}
return list ?? "Not Found";
};
const md = [
`<!-- COPY START -->`,
"```yaml",
`OS: ${details.os.name} ${details.os.version}`,
`CPU: ${details.cpu}`,
`Shell: ${details.shell}`,
`node: ${details.node.version} (${details.node.path})`,
`npm: ${details.npm.version}`,
`nativescript: ${details.nativescript.version}`,
``,
`# android`,
`java: ${details.java.version}`,
`javac: ${details.javac.version}`,
`ndk: ${asYamlList(details.android.installedNDKVersions)}`,
`apis: ${asYamlList(details.android.installedTargets)}`,
`build_tools: ${asYamlList(details.android.installedBuildTools)}`,
`system_images: ${asYamlList(details.android.installedSystemImages)}`,
``,
`# ios`,
`xcode: ${details.xcode.version} (${details.xcode.buildVersion})`,
`cocoapods: ${details.cocoapods.version}`,
`python: ${details.python.version}`,
// `ruby: ${details.ruby.version}`,
`platforms: ${asYamlList(details.ios.platforms)}`,
"```",
``,
`### Dependencies`,
``,
"```json",
'"dependencies": ' + JSON.stringify({}, null, 2) + ",",
'"devDependencies": ' + JSON.stringify({}, null, 2),
"```",
`<!-- COPY END -->`,
``,
green.bold(`√ Results have been copied to your clipboard`),
``,
].join("\n");
console.log(md);
}