From ba3758393fbb9aa84f14123b3975a9e0c899f1ee Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Linus=20Unneb=C3=A4ck?= Date: Sun, 8 Jan 2017 21:06:47 +0100 Subject: [PATCH] feat(commit): print deprecation warning when using provided inquirer Adapters should depend directly on inquirer instead of using the one provided by us. --- src/commitizen/commit.js | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/commitizen/commit.js b/src/commitizen/commit.js index c5056aa1..31a56997 100644 --- a/src/commitizen/commit.js +++ b/src/commitizen/commit.js @@ -1,4 +1,5 @@ import path from 'path'; +import {deprecate} from 'util'; import pify from 'pify'; import dedent from 'dedent'; @@ -11,7 +12,11 @@ export default commit; function askUser (inquirer, prompter) { return new Promise(function (resolve, reject) { - prompter(inquirer, function (arg0, arg1) { + const decoratedInquirer = { + prompt: deprecate(inquirer.prompt, 'Using the supplied copy of inquirer is depreacted, please depend on inquirer directly').bind(inquirer) + } + + prompter(decoratedInquirer, function (arg0, arg1) { // Allow adapters to error out by providing an Error if (arg0 instanceof Error) { return reject(arg0);