owl-cli 6.209.0 → 6.211.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/bin/owl.js +29 -2
  2. package/package.json +1 -1
package/bin/owl.js CHANGED
@@ -2,10 +2,11 @@
2
2
 
3
3
  const {lstatSync, readdirSync} = require('fs')
4
4
  const fs = require('fs')
5
- const {join, resolve} = require('path')
5
+ const {join, resolve,dirname,basename} = require('path')
6
6
  const {getFormSpecs, flattenFormSpecs} = require('./dsl')
7
7
  const {genTableSql} = require('./table_mysql.js');
8
8
  const template = require('art-template')
9
+ const path = require('path');
9
10
 
10
11
  const isDirectory = source => lstatSync(source).isDirectory()
11
12
  const isFile = source => {
@@ -319,4 +320,30 @@ var fulloutPath = resolve(cwd,outPath);
319
320
  mkdir(fulloutPath);
320
321
 
321
322
 
322
- processInputDir(inPath, fulloutPath, templatePath, buildType,project);
323
+
324
+ var inputPattern = null;
325
+ if(process.argv.length>2){
326
+ inputPattern = process.argv[2];
327
+ console.log("compiling" + inputPattern);
328
+ }
329
+
330
+ if(inputPattern){
331
+ if(isDirectory(inputPattern)){
332
+ let inDir = resolve(inPath,inputPattern);
333
+ let outDir = resolve(fulloutPath,inputPattern);
334
+ processInputDir(inDir, outDir, templatePath, buildType,project);
335
+ return;
336
+ }
337
+ else if (inputPattern.indexOf('.json') > 0) {
338
+ let inDir = dirname(resolve(cwd,inPath,inputPattern));
339
+ let name =basename(resolve(cwd,inPath,inputPattern));
340
+ let outDir = dirname(resolve(cwd,fulloutPath,inputPattern));
341
+ processOwlFile(inDir, name, outDir, templatePath, buildType, dir, project)
342
+ console.log("processed " + name);
343
+ return;
344
+ }
345
+ }
346
+ else{
347
+ processInputDir(inPath, fulloutPath, templatePath, buildType,project);
348
+ }
349
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "owl-cli",
3
- "version": "6.209.0",
3
+ "version": "6.211.0",
4
4
  "main": "index.js",
5
5
  "preferGlobal": true,
6
6
  "bin": {