Skip to content

Commit

Permalink
feat: add cli stub to project
Browse files Browse the repository at this point in the history
Refs: #30
  • Loading branch information
tshemsedinov committed Sep 14, 2020
1 parent 2de4616 commit 574b0f5
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 1 deletion.
12 changes: 12 additions & 0 deletions bin/cli.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/usr/bin/env node
'use strict';

const path = require('path');
const metasql = require('..');

const [,, arg] = process.argv;

if (arg === 'g') {
const schemaPath = path.join(__dirname, '../application/schemas');
metasql.migrate(schemaPath);
}
6 changes: 5 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,13 @@
"version": "0.1.3",
"description": "Metarhia SQL builder",
"main": "sql.js",
"bin": {
"metasql": "bin/cli.js"
},
"files": [
"lib/",
"typings/"
"typings/",
"bin/"
],
"scripts": {
"lint": "eslint . && remark . && prettier --check \"**/*.js\" \"**/*.json\" \"**/*.md\" \"**/.*rc\" \"**/*.yml\" \"**/*.ts\"",
Expand Down

0 comments on commit 574b0f5

Please sign in to comment.