machines/sails-gulpify.js
function (userInput){
        var firstTimeRun = userInput.toLowerCase();
        if(firstTimeRun === 'yes'){
          createGulpFile({
            gulpFileSrcPath: '../templates/gulpfile.js',
            outputDir: '../../../gulpfile.js'
          }).exec({
            error: function (err){
              console.error('an error occurred- error details:',err);
              return exits.error();
            },
            invalid: function (){ exits.invalid() },
            success: function() {
              createGulpTasks({
                gulpFolderSrcPath: '../templates/tasks-gulp',
                outputFolderDir: '../../../tasks-gulp'
              }).exec({
                error: function (err){
                  console.error('an error occurred- error details:',err);
                  return exits.error();
                },
                invalid: function (){ exits.invalid() },
                success: function() {
                  createGulpEngine({
                    gulpFolderSrcPath: '../lib/gulp',
                    outputDir: '../../sails/lib/hooks/gulp'
                    //outputDir: '../../../api/hooks/gulp'
                  }).exec({
                    error: function (err){
                      console.error('an error occurred- error details:',err);
                      return exits.error();
                    },
                    invalid: function (){ exits.invalid() },
                    success: function() {
                      // return exits.success();
                      toggleSailsrc({
                        sailsrcSrc: '../json/gulp.sailsrc',
                        outputDir: '../../../.sailsrc'
                      }).exec({
                        error: function (err){
                          console.error('an error occurred- error details:',err);
                          return exits.error();
                        },
                        invalid: function (){ exits.invalid() },
                        success: function() {
                          // return exits.success();
                          installGulpDependencies({
                          }).exec({
                            error: function (err){
                              console.error('an error occurred- error details:',err);
                              return exits.error();
                            },
                            invalid: function (){ exits.invalid() },
                            success: function() {
                              return exits.success();
                            }
                          });
                        }
                      });
                    }
                  });
                }
              });
            }
          });
        }
        else if(firstTimeRun === 'no') {
          createGulpEngine({
            gulpFolderSrcPath: '../lib/gulp',
            outputDir: '../../sails/lib/hooks/gulp'
            //outputDir: '../../../api/hooks/gulp'
          }).exec({
            error: function (err){
              console.error('an error occurred- error details:',err);
              return exits.error();
            },
            invalid: function (){ exits.invalid() },
            success: function() {
              return exits.success();
            }
          });
        }
      }
function (userInput){
        var firstTimeRun = userInput.toLowerCase();
        if(firstTimeRun === 'yes'){
          createGulpFile({
            gulpFileSrcPath: '../templates/gulpfile.js',
            outputDir: '../../../gulpfile.js'
          }).exec({
            error: function (err){
              console.error('an error occurred- error details:',err);
              return exits.error();
            },
            invalid: function (){ exits.invalid() },
            success: function() {
              createGulpTasks({
                gulpFolderSrcPath: '../templates/tasks-gulp',
                outputFolderDir: '../../../tasks-gulp'
              }).exec({
                error: function (err){
                  console.error('an error occurred- error details:',err);
                  return exits.error();
                },
                invalid: function (){ exits.invalid() },
                success: function() {
                  createGulpEngine({
                    gulpFolderSrcPath: '../lib/gulp',
                    outputDir: '../../sails/lib/hooks/gulp'
                    //outputDir: '../../../api/hooks/gulp'
                  }).exec({
                    error: function (err){
                      console.error('an error occurred- error details:',err);
                      return exits.error();
                    },
                    invalid: function (){ exits.invalid() },
                    success: function() {
                      // return exits.success();
                      toggleSailsrc({
                        sailsrcSrc: '../json/gulp.sailsrc',
                        outputDir: '../../../.sailsrc'
                      }).exec({
                        error: function (err){
                          console.error('an error occurred- error details:',err);
                          return exits.error();
                        },
                        invalid: function (){ exits.invalid() },
                        success: function() {
                          // return exits.success();
                          installGulpDependencies({
                          }).exec({
                            error: function (err){
                              console.error('an error occurred- error details:',err);
                              return exits.error();
                            },
                            invalid: function (){ exits.invalid() },
                            success: function() {
                              return exits.success();
                            }
                          });
                        }
                      });
                    }
                  });
                }
              });
            }
          });
        }
        else if(firstTimeRun === 'no') {
          createGulpEngine({
            gulpFolderSrcPath: '../lib/gulp',
            outputDir: '../../sails/lib/hooks/gulp'
            //outputDir: '../../../api/hooks/gulp'
          }).exec({
            error: function (err){
              console.error('an error occurred- error details:',err);
              return exits.error();
            },
            invalid: function (){ exits.invalid() },
            success: function() {
              return exits.success();
            }
          });
        }
      }
function ( userInput ) { var firstTimeRun = userInput . toLowerCase ( ) ; if ( firstTimeRun === 'yes' ) { createGulpFile ( { gulpFileSrcPath : '../templates/gulpfile.js' , outputDir : '../../../gulpfile.js' } ) . exec ( { error : function ( err ) { console . error ( 'an error occurred- error details:' , err ) ; return exits . error ( ) ; } , invalid : function ( ) { exits . invalid ( ) } , success : function ( ) { createGulpTasks ( { gulpFolderSrcPath : '../templates/tasks-gulp' , outputFolderDir : '../../../tasks-gulp' } ) . exec ( { error : function ( err ) { console . error ( 'an error occurred- error details:' , err ) ; return exits . error ( ) ; } , invalid : function ( ) { exits . invalid ( ) } , success : function ( ) { createGulpEngine ( { gulpFolderSrcPath : '../lib/gulp' , outputDir : '../../sails/lib/hooks/gulp' //outputDir: '../../../api/hooks/gulp' } ) . exec ( { error : function ( err ) { console . error ( 'an error occurred- error details:' , err ) ; return exits . error ( ) ; } , invalid : function ( ) { exits . invalid ( ) } , success : function ( ) { // return exits.success(); toggleSailsrc ( { sailsrcSrc : '../json/gulp.sailsrc' , outputDir : '../../../.sailsrc' } ) . exec ( { error : function ( err ) { console . error ( 'an error occurred- error details:' , err ) ; return exits . error ( ) ; } , invalid : function ( ) { exits . invalid ( ) } , success : function ( ) { // return exits.success(); installGulpDependencies ( { } ) . exec ( { error : function ( err ) { console . error ( 'an error occurred- error details:' , err ) ; return exits . error ( ) ; } , invalid : function ( ) { exits . invalid ( ) } , success : function ( ) { return exits . success ( ) ; } } ) ; } } ) ; } } ) ; } } ) ; } } ) ; } else if ( firstTimeRun === 'no' ) { createGulpEngine ( { gulpFolderSrcPath : '../lib/gulp' , outputDir : '../../sails/lib/hooks/gulp' //outputDir: '../../../api/hooks/gulp' } ) . exec ( { error : function ( err ) { console . error ( 'an error occurred- error details:' , err ) ; return exits . error ( ) ; } , invalid : function ( ) { exits . invalid ( ) } , success : function ( ) { return exits . success ( ) ; } } ) ; } }
OK- got user input.
OK - got user input .