Skip to content

Instantly share code, notes, and snippets.

@s992
Created December 4, 2011 03:49
Show Gist options
  • Save s992/1429089 to your computer and use it in GitHub Desktop.
Save s992/1429089 to your computer and use it in GitHub Desktop.
Batch file for creating ColdMVC directory structure
::
:: Directory structure based on the one listed at
:: http://www.coldmvc.com/guide/introduction/directory-structure
:: and some of my own observations on file content.
::
@ECHO OFF
IF "%1" == "" GOTO NeedsArgument ELSE GOTO BuildFolderStructure
:BuildFolderStructure
mkdir %1
:: application.cfc
:: the command, "echo." - with a perid - inserts
:: a blank line
echo /** > %1\Application.cfc
echo * @extends coldmvc.Application >> %1\Application.cfc
echo */ >> %1\Application.cfc
echo component { >> %1\Application.cfc
echo. >> %1\Application.cfc
echo } >> %1\Application.cfc
mkdir %1\app
mkdir %1\app\controllers
copy NUL %1\app\controllers\LayoutController.cfc
mkdir %1\app\helpers
mkdir %1\app\layouts
copy NUL %1\app\layouts\index.cfm
mkdir %1\app\model
mkdir %1\app\tags
mkdir %1\app\views
mkdir %1\config
:: coldspring.xml appears to be empty by default
copy NUL %1\config\coldspring.xml
:: config.ini contains a few settings
echo [default] > %1\config\config.ini
echo. >> %1\config\config.ini
echo [development] >> %1\config\config.ini
echo development = true >> %1\config\config.ini
:: set the environment to development
echo development > %1\config\environment.txt
:: plugins and routes appear to be empty by default
copy NUL %1\config\plugins.cfm
copy NUL %1\config\routes.cfm
mkdir %1\public
mkdir %1\public\css
mkdir %1\public\images
mkdir %1\public\js
:: and our front controller!
:: carets(^) escape reserved characters here
echo ^<cfinclude template="/coldmvc/index.cfm" /^> > %1\public\index.cfm
GOTO End
:NeedsArgument
echo You must provide a directory name as an argument.
:End
echo.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment