Skip to content

Commit

Permalink
fix(app generator): replace depecrated API mkdir() method with alte…
Browse files Browse the repository at this point in the history
…rnative
  • Loading branch information
cueedee committed May 7, 2015
1 parent 84f7e1a commit 861da5f
Showing 1 changed file with 38 additions and 22 deletions.
60 changes: 38 additions & 22 deletions generators/app/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
var generators = require( 'yeoman-generator' )
, yosay = require( 'yosay' )
, youtil = require( './../../lib/youtil.js' )
, mkdirp = require( 'mkdirp' )
, _ = require( 'lodash' )
;

Expand Down Expand Up @@ -160,35 +161,50 @@ module.exports = generators.Base.extend(
{
setupDirectoryStructure: function ()
{
// Create base folders
//
this.mkdir( 'src' );
this.mkdir( 'test' );
var layout =
[
// App source:

// Create Backbone folders
//
this.mkdir( 'src/models' );
this.mkdir( 'src/collections' );
// this.mkdir( 'src/routers' );
this.mkdir( 'src/views' );
'src'

// Create vendor library folder
//
this.mkdir( 'vendor' );
// Backbone:

, 'src/collections'
, 'src/models'
, 'src/views'

// Style and Compass:

, 'src/sass'

, 'src/style'
, 'src/style/images/'
, 'src/style/images/sprites/'

// Testing:

// Create i18n folder
, 'test'

// Third-party, external libraries:

, 'vendor'
]
;

// Location for 'i' + 'nternationalisatio'.length + 'n' definitions:
//
// https://github.com/marviq/madlib-locale#readme
//
if ( this.i18n === true )

if ( this.i18n )
{
this.mkdir( 'src/i18n' );
layout.push( 'src/i18n' );
}

// Create compass folders
//
this.mkdir( 'src/sass' );
this.mkdir( 'src/style' );
this.mkdir( 'src/style/images' );
this.mkdir( 'src/style/images/sprites' );
for ( var i=0, l=layout.length; i < l ; i++ )
{
mkdirp.sync( this.destinationPath( layout[ i ] ));
}
}

, setupProjectFiles: function()
Expand Down

0 comments on commit 861da5f

Please sign in to comment.