From 1505e16fe512832cf04194f67da0d8b6d8efab62 Mon Sep 17 00:00:00 2001 From: Timur Shemsedinov Date: Wed, 16 Sep 2020 03:34:20 +0300 Subject: [PATCH] fix: cli path Refs: https://github.com/metarhia/metasql/issues/30 --- bin/cli.js | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/bin/cli.js b/bin/cli.js index 97260f5..ea6ec95 100755 --- a/bin/cli.js +++ b/bin/cli.js @@ -6,7 +6,10 @@ const metasql = require('..'); const [,, command, version] = process.argv; -const schemaPath = path.join(__dirname, '../application/schemas'); +const dir = __dirname.includes('node_modules') + ? process.cwd() + : path.join(__dirname, '..'); +const schemaPath = path.join(dir, 'application/schemas'); if (command === 'c') { metasql.create(schemaPath, schemaPath);