Skip to content

Instantly share code, notes, and snippets.

@tijmenb
Created May 5, 2011 13:08
Show Gist options
  • Select an option

  • Save tijmenb/956993 to your computer and use it in GitHub Desktop.

Select an option

Save tijmenb/956993 to your computer and use it in GitHub Desktop.

Revisions

  1. tijmenb revised this gist Jul 7, 2011. 7 changed files with 6 additions and 11 deletions.
    Empty file removed app/tmp/cache/models/.keep
    Empty file.
    Empty file removed app/tmp/cache/persistent/.keep
    Empty file.
    Empty file removed app/tmp/cache/views/.keep
    Empty file.
    Empty file removed app/tmp/logs/.keep
    Empty file.
    Empty file removed app/tmp/sessions/.keep
    Empty file.
    Empty file removed app/tmp/tests/.keep
    Empty file.
    17 changes: 6 additions & 11 deletions cakegittmpdirs
    Original file line number Diff line number Diff line change
    @@ -12,22 +12,17 @@ rm .gitignore
    rm -rf app/tmp

    # Set up directories
    mkdir app/tmp
    mkdir app/tmp/cache
    mkdir app/tmp/cache/models
    mkdir app/tmp/cache/persistent
    mkdir app/tmp/cache/views
    mkdir app/tmp/logs
    mkdir app/tmp/sessions
    mkdir app/tmp/tests
    mkdir -p app/tmp/cache/models
    mkdir -p app/tmp/cache/persistent
    mkdir -p app/tmp/cache/views
    mkdir -p app/tmp/logs
    mkdir -p app/tmp/sessions
    mkdir -p app/tmp/tests

    # Make the directories itself writeable
    chmod -R 777 app/tmp
    chmod -R 777 app/tmp/

    # Add .keep files to the directories
    touch app/tmp/.keep
    touch app/tmp/cache/.keep
    touch app/tmp/cache/models/.keep
    touch app/tmp/cache/persistent/.keep
    touch app/tmp/cache/views/.keep
  2. tijmenb revised this gist Jul 7, 2011. 6 changed files with 0 additions and 0 deletions.
    Empty file added app/tmp/cache/models/.keep
    Empty file.
    Empty file added app/tmp/cache/persistent/.keep
    Empty file.
    Empty file added app/tmp/cache/views/.keep
    Empty file.
    Empty file added app/tmp/logs/.keep
    Empty file.
    Empty file added app/tmp/sessions/.keep
    Empty file.
    Empty file added app/tmp/tests/.keep
    Empty file.
  3. tijmenb revised this gist Jun 12, 2011. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion cakegittmpdirs
    Original file line number Diff line number Diff line change
    @@ -39,7 +39,7 @@ touch app/tmp/tests/.keep
    git add app/tmp/*

    # Commit the changes
    git commit -m "Set up readme"
    git commit -m "Set up tmp dirs"

    # Add app/tmp/* to gitignore
    echo "app/tmp/*" > .gitignore
  4. tijmenb revised this gist May 5, 2011. 1 changed file with 0 additions and 2 deletions.
    2 changes: 0 additions & 2 deletions cakegittmpdirs
    Original file line number Diff line number Diff line change
    @@ -18,7 +18,6 @@ mkdir app/tmp/cache/models
    mkdir app/tmp/cache/persistent
    mkdir app/tmp/cache/views
    mkdir app/tmp/logs
    mkdir app/tmp/queue
    mkdir app/tmp/sessions
    mkdir app/tmp/tests

    @@ -33,7 +32,6 @@ touch app/tmp/cache/models/.keep
    touch app/tmp/cache/persistent/.keep
    touch app/tmp/cache/views/.keep
    touch app/tmp/logs/.keep
    touch app/tmp/queue/.keep
    touch app/tmp/sessions/.keep
    touch app/tmp/tests/.keep

  5. tijmenb created this gist May 5, 2011.
    49 changes: 49 additions & 0 deletions cakegittmpdirs
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,49 @@
    # Based on: http://stackoverflow.com/questions/2218075/using-git-with-your-cakephp-project

    # Procedure:
    # 1. Remove app/tmp/ from .gitignore
    # 2. touch app/tmp/.keep
    # 3. git add app/tmp/.keep
    # 4. git commit
    # 5. Add app/tmp/ to .gitignore

    # Clean tmpfiles and delete .gitignore
    rm .gitignore
    rm -rf app/tmp

    # Set up directories
    mkdir app/tmp
    mkdir app/tmp/cache
    mkdir app/tmp/cache/models
    mkdir app/tmp/cache/persistent
    mkdir app/tmp/cache/views
    mkdir app/tmp/logs
    mkdir app/tmp/queue
    mkdir app/tmp/sessions
    mkdir app/tmp/tests

    # Make the directories itself writeable
    chmod -R 777 app/tmp
    chmod -R 777 app/tmp/

    # Add .keep files to the directories
    touch app/tmp/.keep
    touch app/tmp/cache/.keep
    touch app/tmp/cache/models/.keep
    touch app/tmp/cache/persistent/.keep
    touch app/tmp/cache/views/.keep
    touch app/tmp/logs/.keep
    touch app/tmp/queue/.keep
    touch app/tmp/sessions/.keep
    touch app/tmp/tests/.keep

    # Add all files to stage
    git add app/tmp/*

    # Commit the changes
    git commit -m "Set up readme"

    # Add app/tmp/* to gitignore
    echo "app/tmp/*" > .gitignore

    # done!