@@ -3,6 +3,7 @@ import * as jsonforms from '@jsonforms/core';
3
3
import * as cp from 'child_process' ;
4
4
import { writeFile , readFile } from 'fs' ;
5
5
var npm = process . platform === 'win32' ? 'npm.cmd' : 'npm' ;
6
+
6
7
/*
7
8
* Clones a git repository and runs npm install on it
8
9
* @param {string } repo the name of the repo that should be cloned
@@ -44,24 +45,10 @@ export function generateUISchema(path: string, callback: (result: string, type?:
44
45
var content = JSON . parse ( data ) ;
45
46
var jsonSchema = jsonforms . generateJsonSchema ( content ) ;
46
47
var jsonUISchema = jsonforms . generateDefaultUISchema ( jsonSchema ) ;
47
- callback ( JSON . stringify ( jsonUISchema ) ) ;
48
48
var newPath = path . substring ( 0 , path . lastIndexOf ( "/" ) ) ;
49
- console . log ( newPath + '/ui-schema.json' ) ;
50
- console . log ( JSON . stringify ( jsonUISchema , null , 2 ) ) ;
51
49
writeFile ( newPath + '/ui-schema.json' , JSON . stringify ( jsonUISchema , null , 2 ) , ( err ) => {
52
50
if ( err ) callback ( err . message , 'err' ) ;
53
51
callback ( 'Successfully generated UI schema' ) ;
54
52
} ) ;
55
53
} ) ;
56
54
}
57
-
58
- /**
59
- * Takes a path and removes the last part
60
- * @param {string } path path to a folder or file
61
- * @return {string } the path without the last part
62
- */
63
- /* function removeLastPathElement(path: string) {
64
- var newPath = path.split('\\');
65
- newPath.pop();
66
- return newPath.join('\\');
67
- } */
0 commit comments