Skip to content

Create a Shell Script to Remove/Clean Composer Managed Directories then run install #31

Closed

Description

@justinyost

So run rm -rf ./Vendor/* && rm -rf ./bin/* && composer install --dev basically?

This is a pretty common action especially when switching between branches.

Activity

  1. beporter commented on Dec 11, 2014

    @beporter
    Contributor

    👍 There's already a branch in-progress that does the "do you have composer available" checking. This might fit in with that nicely and give that script a better reason for existing. (Right now it's silly to have a "safe" way to run composer if it's available, but that can only be installed by already having run composer.) See the f/composer-install bullet on #29.

  2. beporter commented on Dec 11, 2014

    @beporter
    Contributor

    This would raise the degree of difficulty, but it occurs to me that any such script, if it wanted to truly be convenient/portable/safe, should be able to detect the proper directories to purge based on the available composer.json file.

    For example, the Shell-Scripts repo expects consuming projects to specify

      "config": {
        "vendor-dir": "Vendor/",
        "bin-dir": "bin"
      }

    ...which overrides the default vendor/bin/ directory that would normally be used. Especially when it comes to triggering rm "automatically," we need to try to ensure we don't purge anything that we shouldn't be.

  3. beporter commented on Dec 11, 2014

    @beporter
    Contributor

    We're going down a rabbit hole here, but there is a json npm package that can be installed globally and used by shell scripts to read and extract values from .json files. That would make grabbing these values from the composer.json pretty easy.

  4. beporter commented on Jan 15, 2015

    @beporter
    Contributor

    As an additional safety precaution, if the script can not detect the presence of version control (.git/ directory or svn's equivelent maybe?) that could be used as a safety net for an erroneous delete, maybe it should refuse to perform the delete without a prompt of a -y flag to force it.

  5. beporter commented on Jan 15, 2015

    @beporter
    Contributor

    The best place to extend this work is probably from #35.

  6. added a commit that references this issue on Dec 4, 2015
    bf2aec7
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions