masterrecord 0.2.2 → 0.2.3
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.
- package/Migrations/cli.js +12 -2
- package/package.json +2 -2
package/Migrations/cli.js
CHANGED
|
@@ -9,6 +9,7 @@ let fs = require('fs');
|
|
|
9
9
|
let path = require('path');
|
|
10
10
|
var Migration = require('./migrations');
|
|
11
11
|
var globSearch = require("glob");
|
|
12
|
+
const pkg = require(path.join(__dirname, '..', 'package.json'));
|
|
12
13
|
|
|
13
14
|
|
|
14
15
|
const [,, ...args] = process.argv
|
|
@@ -16,9 +17,12 @@ const [,, ...args] = process.argv
|
|
|
16
17
|
|
|
17
18
|
|
|
18
19
|
program
|
|
19
|
-
.version(
|
|
20
|
+
.version(pkg.version, '-v, --version')
|
|
20
21
|
.description('A ORM framework that facilitates the creation and use of business objects whose data requires persistent storage to a database');
|
|
21
22
|
|
|
23
|
+
// Support legacy '-V' as an alias to print version
|
|
24
|
+
program.option('-V', 'output the version');
|
|
25
|
+
|
|
22
26
|
// Instructions : to run command you must go to main project folder is located and run the command using the context file name.
|
|
23
27
|
program
|
|
24
28
|
.command('enable-migrations <contextFileName>')
|
|
@@ -275,4 +279,10 @@ program
|
|
|
275
279
|
|
|
276
280
|
|
|
277
281
|
|
|
278
|
-
program.parse(process.argv);
|
|
282
|
+
program.parse(process.argv);
|
|
283
|
+
|
|
284
|
+
// Handle manual '-V' alias
|
|
285
|
+
const opts = program.opts();
|
|
286
|
+
if (opts && opts.V) {
|
|
287
|
+
console.log(pkg.version);
|
|
288
|
+
}
|
package/package.json
CHANGED
|
@@ -8,7 +8,7 @@
|
|
|
8
8
|
"sync-mysql2" : "^1.0.6",
|
|
9
9
|
"app-root-path": "^3.1.0"
|
|
10
10
|
},
|
|
11
|
-
"version": "0.2.
|
|
11
|
+
"version": "0.2.3",
|
|
12
12
|
"description": "An Object-relational mapping for the Master framework. Master Record connects classes to relational database tables to establish a database with almost zero-configuration ",
|
|
13
13
|
"homepage": "https://github.com/Tailor/MasterRecord#readme",
|
|
14
14
|
"repository": {
|
|
@@ -22,6 +22,6 @@
|
|
|
22
22
|
"author": "Alexander Rich",
|
|
23
23
|
"license": "ISC",
|
|
24
24
|
"bin": {
|
|
25
|
-
"masterrecord": "./
|
|
25
|
+
"masterrecord": "./Migrations/cli.js"
|
|
26
26
|
}
|
|
27
27
|
}
|