@@ -4,6 +4,11 @@ import * as jsonforms from '@jsonforms/core';
4
4
import { writeFile , readFile } from 'fs' ;
5
5
6
6
/**
7
+ * Clones a git repository and runs npm install on it
8
+ * @param {string } repo the name of the repo that should be cloned
9
+ * @param {string } path to the folder, where the repo should be cloned into
10
+ * @param {function } callback forwards the current status to the caller
11
+ */
7
12
export function cloneAndInstall ( repo : String , path : string , callback : ( result : string , type ?: string ) => void ) {
8
13
var url = '' ;
9
14
switch ( repo ) {
@@ -33,6 +38,10 @@ export function cloneAndInstall(repo: String, path: string, callback: (result: s
33
38
}
34
39
35
40
/**
41
+ * Generates the default UI Schema from a json schema
42
+ * @param {string } path path to the json schema file
43
+ * @param {function } callback forwards the current status to the caller
44
+ */
36
45
export function generateUISchema ( path : string , callback : ( result : string , type ?: string ) => void ) {
37
46
readFile ( path , 'utf8' , ( err , data ) => {
38
47
if ( err ) callback ( err . message , 'err' ) ;
@@ -47,6 +56,11 @@ export function generateUISchema(path: string, callback: (result: string, type?:
47
56
} ) ;
48
57
}
49
58
59
+ /**
60
+ * Takes a path and removes the last part
61
+ * @param {string } path path to a folder or file
62
+ * @return {string } the path without the last part
63
+ */
50
64
function removeLastPathElement ( path : string ) {
51
65
var newPath = path . split ( '\\' ) ;
52
66
newPath . pop ( ) ;
0 commit comments