Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(commit): print deprecation warning when using provided inquirer #416

Merged
merged 1 commit into from
Jan 9, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion src/commitizen/commit.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import path from 'path';
import {deprecate} from 'util';

import pify from 'pify';
import dedent from 'dedent';
Expand All @@ -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);
Expand Down