|
18 | 18 |
|
19 | 19 | var fs = require('fs'); |
20 | 20 | var path = require('path'); |
21 | | -var request = require('request'); |
22 | 21 |
|
23 | 22 | var argv = require('minimist')(process.argv.slice(2)); |
24 | 23 | var colors = require('colors'); |
@@ -114,22 +113,22 @@ if (argv.help || argv.h) { |
114 | 113 | data.src = sourcePath; |
115 | 114 | if (argv.wottd || /\.jsonld$/.test(sourcePath)) { |
116 | 115 | // Explicitly a Web Of Things request |
117 | | - promise = nodegen.wottd2node(data, options); |
| 116 | + promise = nodegen.WebOfThingsGenerator(data, options); |
118 | 117 | } else if (/^https?:/.test(sourcePath) || /.yaml$/.test(sourcePath)) { |
119 | 118 | // URL/yaml -> swagger |
120 | | - promise = nodegen.swagger2node(data, options); |
| 119 | + promise = nodegen.SwaggerNodeGenerator(data, options); |
121 | 120 | } else if (/\.json$/.test(sourcePath)) { |
122 | 121 | // JSON could be a Function node, or Swagger |
123 | 122 | var content = JSON.parse(fs.readFileSync(sourcePath)); |
124 | 123 | if (Array.isArray(content)) { |
125 | 124 | data.src = content; |
126 | | - promise = nodegen.function2node(data, options); |
| 125 | + promise = nodegen.FunctionNodeGenerator(data, options); |
127 | 126 | } else { |
128 | | - promise = nodegen.swagger2node(data, options); |
| 127 | + promise = nodegen.SwaggerNodeGenerator(data, options); |
129 | 128 | } |
130 | 129 | } else if (/\.js$/.test(sourcePath)) { |
131 | 130 | // .js -> Function node |
132 | | - promise = nodegen.function2node(data, options); |
| 131 | + promise = nodegen.FunctionNodeGenerator(data, options); |
133 | 132 | } else { |
134 | 133 | console.error('error: Unsupported file type'); |
135 | 134 | help(); |
|
0 commit comments