Skip to content

Instantly share code, notes, and snippets.

@willgopublic
Created January 4, 2017 10:04
Show Gist options
  • Select an option

  • Save willgopublic/1e8e616f9bbe20f3ccd917c9364cfecb to your computer and use it in GitHub Desktop.

Select an option

Save willgopublic/1e8e616f9bbe20f3ccd917c9364cfecb to your computer and use it in GitHub Desktop.

Revisions

  1. Younès revised this gist Oct 22, 2015. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion post-receive
    Original file line number Diff line number Diff line change
    @@ -20,7 +20,7 @@ if [ -f composer.json ]; then
    fi

    # Run composer if composer.json is updated
    if [ composer.json -nt composer.lock ]; then
    if [ ! -e composer.lock ] || [ composer.json -nt composer.lock ]; then

    # Install or update depending on lock file
    echo "Updating Composer packages"
  2. @younes0 younes0 renamed this gist Oct 15, 2013. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. Younès revised this gist Aug 6, 2013. 1 changed file with 3 additions and 1 deletion.
    4 changes: 3 additions & 1 deletion post-merge-composer
    Original file line number Diff line number Diff line change
    @@ -1,6 +1,8 @@
    #!/bin/bash

    # replace folder
    # thanks http://www.jenssegers.be/blog/46/deploying-websites-with-git-and-composer-

    # replace folder
    cd "`dirname $0`/../../application/config"

    # Check if a composer.json file is present
  4. Younès created this gist Aug 6, 2013.
    34 changes: 34 additions & 0 deletions post-merge-composer
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,34 @@
    #!/bin/bash

    # replace folder
    cd "`dirname $0`/../../application/config"

    # Check if a composer.json file is present
    if [ -f composer.json ]; then

    # Detect composer binary
    if which composer >/dev/null; then
    composer='composer'
    elif which composer.phar >/dev/null; then
    composer='composer.phar'
    else
    # Install composer
    curl -s http://getcomposer.org/installer | php >/dev/null
    composer='php composer.phar'
    fi

    # Run composer if composer.json is updated
    if [ composer.json -nt composer.lock ]; then

    # Install or update depending on lock file
    echo "Updating Composer packages"
    [ ! -f composer.lock ] && $composer install || $composer update

    else

    # Regenerating autoload files
    echo "Composer packages up to date"
    $composer dump-autoload

    fi
    fi