Giter Club home page Giter Club logo

heroku-cli-util's Issues

run.js uses nonexistent "shortHelp" property

The command list printing code at run.js line 12 tries to print a shortHelp property from the command object, but neither of the example plugins provides such a string, and heroku-cli's Command struct doesn't have such a field. If I had to guess, I'd say that this project should use the description field instead, but it's possible that I've misunderstood the meaning of the various help-related keys, or that shortHelp is correct and everything else should be updated instead.

Cannot assign to read only property 'has256'

Since this morning i'm getting this error:

2016/04/08 09:38:28 truncating error log...
2016/04/08 09:38:28 cleaning up tmp dirs...
2016/04/08 09:38:28 heroku-cli: Installing core plugins...
2016/04/08 09:38:28 open /var/lib/buildkite-agent/.heroku/config.json: no such file or directory
2016/04/08 09:39:02  done
2016/04/08 09:39:02 open /var/lib/buildkite-agent/.heroku/config.json: no such file or directory
2016/04/08 09:39:02 open /var/lib/buildkite-agent/.heroku/config.json: no such file or directory
2016/04/08 09:39:04 TypeError: Cannot assign to read only property 'has256' of false
    at findBestHerokuColor (/var/lib/buildkite-agent/.heroku/node_modules/heroku-run/node_modules/heroku-cli-util/lib/spinner.js:9:19)
    at new Spinner (/var/lib/buildkite-agent/.heroku/node_modules/heroku-run/node_modules/heroku-cli-util/lib/spinner.js:28:23)
    at Run.updateStatus (/var/lib/buildkite-agent/.heroku/node_modules/heroku-run/commands/run.js:41:22)
    at Run.<anonymous> (/var/lib/buildkite-agent/.heroku/node_modules/heroku-run/commands/run.js:21:12)
    at next (native)
    at onFulfilled (/var/lib/buildkite-agent/.heroku/node_modules/co/index.js:65:19)
    at _fulfilled (/var/lib/buildkite-agent/.heroku/node_modules/q/q.js:834:54)
    at self.promiseDispatch.done (/var/lib/buildkite-agent/.heroku/node_modules/q/q.js:863:30)
    at Promise.promise.promiseDispatch (/var/lib/buildkite-agent/.heroku/node_modules/q/q.js:796:13)
    at /var/lib/buildkite-agent/.heroku/node_modules/q/q.js:604:44

This may be connected to your latest changed @dickeyxxx . Do you have any idea what went wrong?

Advanced Errors

Idea for new functionality for errors. Using restify-errors as inspiration, we could have a Heroku error type to generate custom errors.

Property ideas:

  • URL for docs
  • file?
  • example usage
  • error title
  • error description
  • plugin name
  • topic:command

API Caching

I think it would be useful, especially for slow commands like heroku addons and heroku dashboard if the CLI cached some common requests.

heroku-client already supports caching, we could store them in XDG_CACHE_HOME/heroku, so this change wouldn't be hard.

There may be some security (not serious ones, the .netrc file is already on disk) and disk space implications of caching everything indiscriminately, so a whitelist of only items we want to cache is important here. We probably want to chmod the files down to 0600 as well.

This depends on the result of heroku/node-heroku-client#66 I think. I want to make sure we get the caching right before just slapping this in.

Clarify usage of this vs newer(?) modules

Hi there!

I was reading through some docs and noticed they've changed a lot since I wrote my plugin last year. The biggest difference is the introduction of cli-engine-heroku, heavily featured in the intro article. Looks pretty slick!

I'd love to see some documentation on future plans for the modules (is cli-util getting deprecated in favor of cli-engine?). For instance, if I was starting a new module today, which should I use? Is it worth updating an existing plugin with the new modules? If it's not right now (docs not ready, whatever), is there a planned point where that's the recommended action?

Related, the in the code link in this section is 404.

Add pretty object and table print

The ruby CLI has nice functions for printing an object including a header and indenting. e.g.

=== example
Source type: github
Source repo: heroku/example
Staging:     example-staging
Production:  example
             example-admin
Flow:        example-staging --> example, example-admin

It would be great to have that in here so we have consistent output. Likewise for tables.

Undefined property missing or not caught

Need to explore more, but:

$ heroku local:run bin/rails -v
[OKAY] Loaded ENV .env File as KEY=VALUE Format
Could not find i18n-0.7.0 in any of the sources
Run `bundle install` to install missing gems.
TypeError: Cannot read property 'body' of undefined
    at getErrorMessage (/Users/user/src/github.com/heroku/heroku-local/node_modules/heroku-cli-util/lib/errors.js:33:10)
    at error (/Users/user/src/github.com/heroku/heroku-local/node_modules/heroku-cli-util/lib/errors.js:53:30)
    at handleErr (/Users/user/src/github.com/heroku/heroku-local/node_modules/heroku-cli-util/lib/errors.js:100:23)
    at process._tickCallback (internal/process/next_tick.js:109:7)

When two factor is requested, would it be possible to preauth globally?

@dickeyxxx @mikehale pointed out that when he was doing heroku config on a 2fa app, it would prompt over an over, until he ran heroku apps:info after which heroku config stopped prompting. He was wondering the difference and it comes down to preAuth being set in apps:info. Besides performance, is there a reason that preAuth behavior is not the default. Having this behavior appear & disappear does seem inconsistent.

return cli.preauth(context.app, heroku(context), secondFactor)

Invalid left-hand side in assignment

Hey guys! The when I require the module, I'm getting what looks like a syntax error?

% node
> let cli = require('heroku-cli-util')
/Users/david/projects/heroku-config/node_modules/heroku-cli-util/lib/action.js:16
  if (options.then) [options, promise] = [{}, options]
                    ^^^^^^^^^^^^^^^^^^
ReferenceError: Invalid left-hand side in assignment
    at exports.runInThisContext (vm.js:53:16)
    at Module._compile (module.js:387:25)
    at Object.Module._extensions..js (module.js:422:10)
    at Module.load (module.js:357:32)
    at Function.Module._load (module.js:314:12)
    at Module.require (module.js:367:17)
    at require (internal/module.js:16:19)
    at Object.<anonymous> (/Users/david/projects/heroku-config/node_modules/heroku-cli-util/index.js:11:18)
    at Module._compile (module.js:413:34)
    at Object.Module._extensions..js (module.js:422:10)

Versions
Node: 5.7.1
heroku-cli-util: 6.0.13

For now I'll just downgrade, but I thought it's something you might be interested in. Thanks!

Edit: The last version without this error is 6.0.3.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.