build/updates/builder.js
function (cb) {
            var self = this;
            var dirs = ['classes', 'modules', 'files'];
            if (self.options.dumpview) {
                dirs.push('json');
            }
            var writeRedirect = function (dir, file, cb) {
                Y.Files.exists(file, function (x) {
                    if (x) {
                        var out = path.join(dir, 'index.html');
                        fs.createReadStream(file).pipe(fs.createWriteStream(out));
                    }
                    cb();
                });
            };
            var defaultIndex = path.join(themeDir, 'assets', 'index.html');
            var stack = new Y.Parallel();
            Y.log('Making default directories: ' + dirs.join(','), 'info', 'builder');
            dirs.forEach(function (d) {
                var dir = path.join(self.options.outdir, d);
                Y.Files.exists(dir, stack.add(function (x) {
                    if (!x) {
                        fs.mkdir(dir, 0777, stack.add(function () {
                            writeRedirect(dir, defaultIndex, stack.add(noop));
                        }));
                    } else {
                        writeRedirect(dir, defaultIndex, stack.add(noop));
                    }
                }));
            });
            stack.done(function () {
                if (cb) {
                    cb();
                }
            });
        }
function (cb) {
            var self = this;
            var dirs = ['classes', 'modules', 'files'];
            if (self.options.dumpview) {
                dirs.push('json');
            }
            var writeRedirect = function (dir, file, cb) {
                Y.Files.exists(file, function (x) {
                    if (x) {
                        var out = path.join(dir, 'index.html');
                        fs.createReadStream(file).pipe(fs.createWriteStream(out));
                    }
                    cb();
                });
            };
            var defaultIndex = path.join(themeDir, 'assets', 'index.html');
            var stack = new Y.Parallel();
            Y.log('Making default directories: ' + dirs.join(','), 'info', 'builder');
            dirs.forEach(function (d) {
                var dir = path.join(self.options.outdir, d);
                Y.Files.exists(dir, stack.add(function (x) {
                    if (!x) {
                        fs.mkdir(dir, 0777, stack.add(function () {
                            writeRedirect(dir, defaultIndex, stack.add(noop));
                        }));
                    } else {
                        writeRedirect(dir, defaultIndex, stack.add(noop));
                    }
                }));
            });
            stack.done(function () {
                if (cb) {
                    cb();
                }
            });
        }
function ( cb ) { var self = this ; var dirs = [ 'classes' , 'modules' , 'files' ] ; if ( self . options . dumpview ) { dirs . push ( 'json' ) ; } var writeRedirect = function ( dir , file , cb ) { Y . Files . exists ( file , function ( x ) { if ( x ) { var out = path . join ( dir , 'index.html' ) ; fs . createReadStream ( file ) . pipe ( fs . createWriteStream ( out ) ) ; } cb ( ) ; } ) ; } ; var defaultIndex = path . join ( themeDir , 'assets' , 'index.html' ) ; var stack = new Y . Parallel ( ) ; Y . log ( 'Making default directories: ' + dirs . join ( ',' ) , 'info' , 'builder' ) ; dirs . forEach ( function ( d ) { var dir = path . join ( self . options . outdir , d ) ; Y . Files . exists ( dir , stack . add ( function ( x ) { if ( ! x ) { fs . mkdir ( dir , 0777 , stack . add ( function ( ) { writeRedirect ( dir , defaultIndex , stack . add ( noop ) ) ; } ) ) ; } else { writeRedirect ( dir , defaultIndex , stack . add ( noop ) ) ; } } ) ) ; } ) ; stack . done ( function ( ) { if ( cb ) { cb ( ) ; } } ) ; }
Makes the default directories needed
@method makeDirs
@param {Callback} cb The callback to execute after it's completed
Makes the default directories needed