pwmckenna / node-travis-encrypt

node module to encrypt environment variables for travis-ci
npmjs.org/package/travis-encrypt
46 stars 12 forks source link

Issue with regular travis encrypt with three args #10

Closed nicosommi closed 8 years ago

nicosommi commented 9 years ago

Hello, I'm getting an error when no user and password is send to the library using it as a module. I created a gist with a test using the example code on the readme. See below

This is the error: TypeError: callback is not a function /lib/travis-encrypt.js:64:16

Steps to reproduce it

git clone https://gist.github.com/nicosommi/acfcdaaf44590a239bfc
cd acfcdaaf44590a239bfc
npm install
mocha index.js
rexxars commented 8 years ago

I really want to change the API for this module, to take an options object instead of individual arguments (obviously bumping the major version to indicate the breaking change). Am I allowed to do this, @pwmckenna?

Until then, you'll have to use it like this:

encrypt('pwmckenna/node-travis-encrypt', 'FOO=BAR', undefined, undefined, function(err, result) {
    // Do something with the result
});

Key part being 2x undefined in the arguments list.

pwmckenna commented 8 years ago

@rexxars sorry for the delay. I consider you as much an owner of this project as I am (and lately, more of one). Feel free!

rstacruz commented 8 years ago

:+1: the arguments API is silly right now.

rexxars commented 8 years ago

Changed the API for this in #19, new version has a more sane API. Closing.