bower executes bundle #2486

Closed
mgol opened this Issue Feb 1, 2014 · 12 comments

10 participants

@mgol

On the latest version of oh-my-zsh the bower command executes bundle, not bower. The definition:

$ which bower
bower () {
    if _bundler-installed && _within-bundled-project
    then
        local bundler_version=`bundle version | cut -d' ' -f3`
        if [[ $bundler_version > '1.4.0' || $bundler_version = '1.4.0' ]]
        then
            if [[ "$(uname)" = 'Darwin' ]]
            then
                local cores_num="$(sysctl hw.ncpu | awk '{print $2}')"
            else
                local cores_num="$(nproc)"
            fi
            bundle install --jobs=$cores_num $@
        else
            bundle install $@
        fi
    else
        echo "Can't 'bundle install' outside a bundled project"
    fi
}

There is no mention of bundle in any files under ~/.oh-my-zsh/plugins/bower/ but removing the bower plugin from my plugins list eliminates the issue.

There are more people experiencing the issue:
http://stackoverflow.com/questions/21009505/bower-runs-as-bundler-on-zsh-oh-my-zsh

@pangratz

I stumbled upon this and I think it is because of a name clash within bundler and bower plugins. I have the bundler and bower plugins enabled in my config. Since the bundler plugin specifies a bi function and the bower plugin specifies an alias bi=bower install, there is a clash. Renaming bundle's bi function to bundle_install fixed the issue for me ...

I don't know how this should be resolved since the 2 plugins both specify a command for bi ...

@pangratz pangratz added a commit that referenced this issue Feb 3, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
b691c74
@kenips

👍 makes sense. This makes it more clear that where the alias comes from.

@vyorkin

👍

@jrencz

what about this one? Is is going to be merged any soon?

@vainikkaj

👍

@fmquaglia

👍

@pangratz

As a quick workaround the bower repository states that when using oh-my-zsh a alias bower='noglob bower' should be used, see https://github.com/bower/bower#warning.

@pangratz pangratz added a commit that referenced this issue Mar 24, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
59425b2
@creasty creasty added a commit to creasty/dotfiles that referenced this issue Apr 1, 2014
@creasty creasty bower executes bundle 4b90dd5
@senta

👍

@kenips

@pangratz noglob only impacts escaping (such as # for versions as in the example). Don't think it can solve this issue here.

@pangratz

@kenips I haven't tried it actually 😊, I have just seen that the bower repository stated something about using it with oh-my-zsh...

@markson

same thing happens here

@ncanceill ncanceill added a commit to ncanceill/oh-my-zsh that referenced this issue May 25, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
c0b094c
@robbyrussell robbyrussell closed this in #2827 Jul 1, 2014
@nicorevin nicorevin added a commit that referenced this issue Jul 1, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
5f4fe9b
@hoggarth hoggarth added a commit to hoggarth/oh-my-zsh that referenced this issue Jul 10, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
6d0fdba
@mcornella mcornella added a commit to mcornella/oh-my-zsh that referenced this issue Jul 20, 2014
@mcornella mcornella Fix pass completion syntax and autoloading
When TAB is pressed, sometimes the following error appears:

  _values:compvalues:10: not enough arguments

From robbyrussell/oh-my-zsh#2486:

> It seems like this does not happen if I have passwords in pass.
> Only happens when pass is "empty".

This is due to lines 104 and 118, where there are the only `_values'
statements. If we follow the execution path it is also confirmed that
the responsible for that error is `_pass_complete_entries_helper()'.

The only thing left to try is the statement inside `$()', which returns
nothing. The output is blank, so `_values' only receives 1 of its 2
mandatory parameters.

To solve it, we wrap the `$()' argument inside double quotes. That way
even if the output of such command is blank, `_values' still receives
2 of its 2 mandatory parameters, therefore not complaining anymore.

This patch also fixes the first tab completion, which is dedicated to
loading the completion function instead of autoloading it properly.
We do this by adding a `_pass' statement at the end of the file, just
like any other completion file does and *needs* to do.
9532c9e
@LucasRoesler LucasRoesler added a commit to LucasRoesler/oh-my-zsh that referenced this issue Jul 22, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
4350172
@swanandp swanandp added a commit to swanandp/oh-my-zsh that referenced this issue Aug 4, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
3ca8404
@trevorwhitney trevorwhitney added a commit to trevorwhitney/oh-my-zsh that referenced this issue Aug 10, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
b5dbb19
@anatoliy-sokolenko anatoliy-sokolenko added a commit to anatoliy-sokolenko/oh-my-zsh that referenced this issue Aug 14, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
ca10508
@erwinvaneijk erwinvaneijk added a commit to erwinvaneijk/oh-my-zsh that referenced this issue Sep 8, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
23042da
@mbologna mbologna added a commit that referenced this issue Sep 17, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
2299949
@pangliang pangliang pushed a commit to pangliang/oh-my-zsh that referenced this issue Oct 13, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
43ccf36
@kogakure kogakure pushed a commit that referenced this issue Nov 10, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
ca5f1fa
@benjaoming benjaoming added a commit to benjaoming/oh-my-zsh that referenced this issue Nov 28, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
a9d4ec5
@trynity trynity pushed a commit to trynity/oh-my-zsh that referenced this issue Nov 29, 2014
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
889df1e
@kenton kenton added a commit to kenton/oh-my-zsh that referenced this issue Jan 9, 2015
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
851a91e
@Kentzo Kentzo added a commit to Kentzo/oh-my-zsh that referenced this issue Jun 13, 2015
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
53bfc07
@NobbZ NobbZ added a commit to NobbZ/oh-my-zsh that referenced this issue May 15, 2016
@pangratz pangratz Fix function/alias naming clash between bower and bundle plugin
Since the `bower` plugin specifies a `bi` alias and `bundle` plugin
specifies a `bi` function, there is a name clash when using both
plugins, which results in the message "Can't 'bundle install' outside a
bundled project" when trying to execute `bower`.

This adresses #2486
b33b6e5
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment