pwmckenna / node-travis-encrypt

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

{"file":"not found"} error #8

Closed rstacruz closed 9 years ago

rstacruz commented 9 years ago
travis-encrypt -r rstacruz/abc KEY=VAL
# KEY
[object Object]

Inspecting [object Object], it's actually err as reported by encrypt() which translates to {"file":"not found"}.

That is:

> require('travis-encrypt')('a/b', 'KEY=VAL', undefined, undefined, console.log)
...
{ file: 'not found' }

Using 1.0.2 from npm.

burnnat commented 9 years ago

I'm experiencing this too, on Windows 7 x86 (not sure if this is OS-dependent). Anybody know of a workaround?

rstacruz commented 9 years ago

I'm getting this on OSX 10.10 + Node.js 0.10, so I can confirm this isn't something that would be OS-dependent :)

pwmckenna commented 9 years ago

i'll fix the [object Object] display issue...as for the actual error, what repo slug are you actually using? is it private?

burnnat commented 9 years ago

Ok, so I think I've figured this out, at least for my situation: I had mistakenly enabled the wrong repo in Travis, so when I switched on the correct repository in the Travis site and re-ran it completed successfully.

Maybe a more enlightening error message might be in order for this case?

pwmckenna commented 9 years ago

it would be fairly straight forward to at least add error handling for this specific case. travis' api doesn't generally provide the most helpful messages though, so being helpful in the most common cases is probably the best we can do.

as a side note, I didn't really know if people were using this out in the wild. it probably deserves at least a small test suite now that it has at least 3 users :)

pwmckenna commented 9 years ago

@burnnat @rstacruz thanks for the input, just released 1.1.1 that does an additional check if the key lookup fails, and tells you if it can't find the repo specified.

repository pwmckenna/node-travis-encrypts not found

the error formatting issue should also be resolved (though I had to remove the red colorizing or the error message). I'm going to add you both as contributors, so if you see additional areas for improvement, feel free.

rstacruz commented 9 years ago

I ran into this as part of https://medium.com/@nthgergo/publishing-gh-pages-with-travis-ci-53a8270e87db by the way!