Skip to content

Instantly share code, notes, and snippets.

@mattfelsen
Last active August 29, 2015 14:08
Show Gist options
  • Save mattfelsen/b50762ed68a9e43f7388 to your computer and use it in GitHub Desktop.
Save mattfelsen/b50762ed68a9e43f7388 to your computer and use it in GitHub Desktop.

Revisions

  1. mattfelsen revised this gist Aug 24, 2015. 1 changed file with 6 additions and 0 deletions.
    6 changes: 6 additions & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,5 +1,11 @@
    #!/bin/bash

    #
    # NOTE: The openFrameworks folder structure (particularly with regard to the projectGenerator)
    # has changed since this script was written, so this will probably not work!
    # (The parts about creating a new project toward the end, at least.)
    #

    #
    # usage:
    #
  2. mattfelsen revised this gist Nov 15, 2014. 1 changed file with 54 additions and 15 deletions.
    69 changes: 54 additions & 15 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -2,21 +2,32 @@

    #
    # usage:
    # ./setup.sh ProjectName http://server/path/to/new/project/repo.git
    #
    # ./setup.sh <project-name> <git-remote-url>
    #
    # examples:
    #
    # For a GitHub-hosted project:
    # ./setup.sh ProjectName https://github.com/local-projects/ProjectName.git
    #
    # For an Assembla-hosted project:
    # ./setup.sh ProjectName [email protected]:project-name.repo-name.git
    #

    # do some checking on $1 and $2 to see if they're empty, whether $1 is a
    # URL and we're already inside the project dir, etc.
    # TODO
    # need to do some checking on $1 and $2 to see if they're empty, whether
    # $1 is a URL and we're already inside the project dir, etc.

    DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

    # create the project folder, move in, make a git repo

    #
    # project folder setup
    #

    # create the project folder, move in
    mkdir $1
    cd $1
    git init

    # change origin remote to point at new project repo
    git remote add origin $2

    # make the folder structure
    mkdir Apps
    @@ -36,22 +47,50 @@ touch Scripts/stop.command
    # create stub for readme
    touch README.md

    # openFrameworks
    # - add as submodule
    # - switch to the stable branch
    # - stage the submodule's commit to the stable branch instead of master

    #
    # git repo setup
    #

    # make a repo
    git init

    # add origin remote to point at new project repo
    git remote add origin $2


    #
    # openFrameworks setup
    #

    # add as submodule
    git submodule add https://github.com/local-projects/openFrameworks.git

    # switch to the stable branch
    # this corresponds to the latest release
    cd openFrameworks
    git checkout stable

    # add the official OF repo as a remote
    # so changes can be synced
    git remote add upstream https://github.com/openframeworks/openFrameworks.git

    # stage the submodule's commit to the stable branch instead of master
    cd ..
    git add openFrameworks


    #
    # openFrameworks projectGenerator
    # - build the projectGenerator
    # - set the projectGenerator OF root to our newly cloned OF repo
    # - create your first app!
    #

    # build the projectGenerator
    cd openFrameworks/apps/devApps/projectGenerator/
    xcodebuild

    # set the projectGenerator OF root to our newly cloned OF repo
    echo $DIR/$1/openFrameworks > ~/.ofprojectgenerator/config

    # create the first app for the new project
    ./bin/emptyExample.app/Contents/MacOS/emptyExample

  3. mattfelsen revised this gist Nov 9, 2014. 1 changed file with 21 additions and 9 deletions.
    30 changes: 21 additions & 9 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,16 +1,22 @@
    #!/bin/bash

    #
    # usage:
    # ./setup.sh ProjectName http://server/path/to/new/project/repo.git
    #

    # do some checking on $1 and $2 to see if they're empty, whether $1 is a
    # URL and we're already inside the project dir, etc.

    # create the project folder & move in

    DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"

    # create the project folder, move in, make a git repo
    mkdir $1
    cd $1
    git init

    # change origin remote to point at new project repo
    git remote add origin $2

    # make the folder structure
    mkdir Apps
    @@ -28,18 +34,24 @@ touch Scripts/start.command
    touch Scripts/stop.command

    # create stub for readme
    touch README.md
    touch README.md

    # openFrameworks
    # - add as submodule
    # - switch to the stable branch
    # - stage the submodule's commit to the stable branch instead of master
    git init
    git submodule add https://github.com/local-projects/openFrameworks.git
    cd openFrameworks
    git checkout stable
    cd ..
    git add openFrameworks

    # change origin remote to point at new project repo
    git remote add origin $2

    # openFrameworks projectGenerator
    # - build the projectGenerator
    # - set the projectGenerator OF root to our newly cloned OF repo
    # - create your first app!
    cd openFrameworks/apps/devApps/projectGenerator/
    xcodebuild
    echo $DIR/$1/openFrameworks > ~/.ofprojectgenerator/config
    ./bin/emptyExample.app/Contents/MacOS/emptyExample

  4. mattfelsen revised this gist Nov 9, 2014. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -34,11 +34,12 @@ touch README.md
    # - add as submodule
    # - switch to the stable branch
    # - stage the submodule's commit to the stable branch instead of master
    git init
    git submodule add https://github.com/local-projects/openFrameworks.git
    cd openFrameworks
    git checkout stable
    cd ..
    git add openFrameworks

    # change origin remote to point at new project repo
    git remote set-url origin $2
    git remote add origin $2
  5. mattfelsen revised this gist Nov 5, 2014. 1 changed file with 3 additions and 2 deletions.
    5 changes: 3 additions & 2 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -5,9 +5,10 @@
    # ./setup.sh ProjectName http://server/path/to/new/project/repo.git
    #

    # add some error-checking to make sure both $1 and $2 are non-empty!
    # do some checking on $1 and $2 to see if they're empty, whether $1 is a
    # URL and we're already inside the project dir, etc.

    # clone the project & move into the dir
    # create the project folder & move in
    mkdir $1
    cd $1

  6. mattfelsen revised this gist Nov 5, 2014. 1 changed file with 43 additions and 0 deletions.
    43 changes: 43 additions & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,43 @@
    #!/bin/bash

    #
    # usage:
    # ./setup.sh ProjectName http://server/path/to/new/project/repo.git
    #

    # add some error-checking to make sure both $1 and $2 are non-empty!

    # clone the project & move into the dir
    mkdir $1
    cd $1

    # make the folder structure
    mkdir Apps
    mkdir Configs
    mkdir Deployment
    mkdir Deployment/Scripts
    mkdir Documentation
    mkdir ExternalAddons
    mkdir Scripts
    mkdir Sketches

    # create stubs for scripts
    touch build.command
    touch Scripts/start.command
    touch Scripts/stop.command

    # create stub for readme
    touch README.md

    # openFrameworks
    # - add as submodule
    # - switch to the stable branch
    # - stage the submodule's commit to the stable branch instead of master
    git submodule add https://github.com/local-projects/openFrameworks.git
    cd openFrameworks
    git checkout stable
    cd ..
    git add openFrameworks

    # change origin remote to point at new project repo
    git remote set-url origin $2
  7. mattfelsen revised this gist Nov 5, 2014. 1 changed file with 0 additions and 22 deletions.
    22 changes: 0 additions & 22 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,22 +0,0 @@
    #!/bin/bash

    #
    # usage:
    # ./setup.sh ProjectName http://server/path/to/new/project/repo.git
    #

    # add some error-checking to make sure both $1 and $2 are non-empty!

    # clone the project & move into the dir
    git clone https://github.com/local-projects/OF-Project-Boilerplate.git
    mv OF-Project-Boilerplate $1
    cd $1

    # pull down all submodules
    git submodule update --init --recursive

    # change origin remote to point at new project repo
    git remote set-url origin $2

    # rename the README template
    mv README.template.md README.md
  8. mattfelsen revised this gist Nov 3, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -16,7 +16,7 @@ cd $1
    git submodule update --init --recursive

    # change origin remote to point at new project repo
    git remote origin set-url $2
    git remote set-url origin $2

    # rename the README template
    mv README.template.md README.md
  9. mattfelsen revised this gist Nov 3, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions setup.sh
    Original file line number Diff line number Diff line change
    @@ -5,6 +5,8 @@
    # ./setup.sh ProjectName http://server/path/to/new/project/repo.git
    #

    # add some error-checking to make sure both $1 and $2 are non-empty!

    # clone the project & move into the dir
    git clone https://github.com/local-projects/OF-Project-Boilerplate.git
    mv OF-Project-Boilerplate $1
  10. mattfelsen revised this gist Nov 3, 2014. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion setup.sh
    Original file line number Diff line number Diff line change
    @@ -2,7 +2,7 @@

    #
    # usage:
    # ./setup ProjectName http://server/path/to/new/project/repo.git
    # ./setup.sh ProjectName http://server/path/to/new/project/repo.git
    #

    # clone the project & move into the dir
  11. mattfelsen renamed this gist Nov 3, 2014. 1 changed file with 2 additions and 0 deletions.
    2 changes: 2 additions & 0 deletions gistfile1.sh → setup.sh
    Original file line number Diff line number Diff line change
    @@ -1,7 +1,9 @@
    #!/bin/bash

    #
    # usage:
    # ./setup ProjectName http://server/path/to/new/project/repo.git
    #

    # clone the project & move into the dir
    git clone https://github.com/local-projects/OF-Project-Boilerplate.git
  12. mattfelsen revised this gist Nov 1, 2014. 1 changed file with 6 additions and 2 deletions.
    8 changes: 6 additions & 2 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -1,14 +1,18 @@
    #!/bin/bash

    # usage:
    # ./setup ProjectName http://server/path/to/new/project/repo.git

    # clone the project & move into the dir
    git clone https://github.com/local-projects/OF-Project-Boilerplate.git
    cd OF-Project-Boilerplate
    mv OF-Project-Boilerplate $1
    cd $1

    # pull down all submodules
    git submodule update --init --recursive

    # change origin remote to point at new project repo
    git remote origin set-url $1
    git remote origin set-url $2

    # rename the README template
    mv README.template.md README.md
  13. mattfelsen created this gist Nov 1, 2014.
    14 changes: 14 additions & 0 deletions gistfile1.sh
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,14 @@
    #!/bin/bash

    # clone the project & move into the dir
    git clone https://github.com/local-projects/OF-Project-Boilerplate.git
    cd OF-Project-Boilerplate

    # pull down all submodules
    git submodule update --init --recursive

    # change origin remote to point at new project repo
    git remote origin set-url $1

    # rename the README template
    mv README.template.md README.md