Skip to content
This repository has been archived by the owner on Jan 21, 2020. It is now read-only.

Added a cleanup routing to the installer #8

Conversation

weierophinney
Copy link
Member

A new Composer post-install-cmd/post-update-cmd now recursively removes the src/Composer/ directory, ensuring a clean skeleton on completion of the install/update.

A new post-install-cmd now recursively removes the `src/Composer/` directory,
ensuring a clean skeleton on completion of the install.
@weierophinney weierophinney added this to the 0.5.3 milestone Oct 16, 2015
@weierophinney
Copy link
Member Author

@xtreamwayz I figured out how to do a cleanup. 😄

The installer should work with both `composer install` as well as `composer
update`; the original installer script already does, but the cleanup needs to
register via `post-update-cmd` as well.
@ezimuel
Copy link

ezimuel commented Oct 16, 2015

@weierophinney just tried with composer install and update, the src/Composer folder is removed.

@geerteltink
Copy link
Member

@weierophinney Nice.

1 thing though:

"scripts": {
    "post-install-cmd": [
        "App\\Composer\\OptionalPackages::install",
        "App\\Composer\\OptionalPackages::cleanUp"
    ],
    "post-update-cmd": [
        "App\\Composer\\OptionalPackages::install",
        "App\\Composer\\OptionalPackages::cleanUp"
    ]
},

Looks better.

@weierophinney
Copy link
Member Author

@xtreamwayz True, but we have 4 separate commands we're using, not two:

  • pre-install-cmd
  • post-install-cmd
  • pre-update-cmd
  • post-update-cmd

So we can't use the array notation here.

@weierophinney
Copy link
Member Author

@xtreamwayz Also, the reason for doing the post-*-cmd vs having those as part of the installer is to ensure order of operations. If I did them within the pre-*-cmd operations, I was getting failures in composer preventing install.

@weierophinney
Copy link
Member Author

@xtreamwayz As it turns out, I was wrong; we can do this as part of the install/update command. I left the routine intact as a separate method, but now call that from within the install command. Works flawlessly. 😄

@weierophinney weierophinney merged commit 1fa757e into zendframework:master Oct 16, 2015
weierophinney added a commit that referenced this pull request Oct 16, 2015
weierophinney added a commit that referenced this pull request Oct 16, 2015
@weierophinney weierophinney deleted the hotfix/cleanup-after-ourselves branch October 16, 2015 18:16
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants