From 54de9dd01164752293e6f222ee320a48b2114b7b Mon Sep 17 00:00:00 2001 From: ffsockets <48462819+ffsockets@users.noreply.github.com> Date: Fri, 12 Apr 2019 15:27:38 +0800 Subject: [PATCH] Create db.js --- src/db.js | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/db.js diff --git a/src/db.js b/src/db.js new file mode 100644 index 0000000..616a6b8 --- /dev/null +++ b/src/db.js @@ -0,0 +1,9 @@ +const path = require('path') +const { execSync } = require('child_process') + +const CLI = (cmd, options = {}) => { + const opts = Object.assign({}, process.env, options.env) + return execSync(`node "${path.resolve(__dirname, '../src/bin')}" ${cmd}`, opts) +} + +module.exports = CLI