Пример #1
0
exports._gitAddAll = function(mainCallback) {
    command.open(root)
        .on('stdout', command.writeTo(process.stdout))
        .on('stderr', command.writeTo(process.stderr))
        .exec('git', ['add', '.'])
        .then(function() {
            mainCallback();
        });
};
Пример #2
0
exports._gitCommit = function(mainCallback) {
    command.open(root)
        .on('stdout', command.writeTo(process.stdout))
        .on('stderr', command.writeTo(process.stderr))
        .exec('git', ['commit', '-m', 'Regenerate'])
        .then(function() {
            mainCallback();
        });
};
Пример #3
0
 function(mainCallback) {
     command.open(ROOT)
         .on('stdout', command.writeTo(process.stdout))
         .on('stderr', command.writeTo(process.stderr))
         .exec('git', ['checkout', dependency.version, '-f'], { cwd: dependency.folder })
         .then(function() {
             mainCallback();
         });
 },
Пример #4
0
exports._gitPushToBranch = function(mainCallback, remote, branch) {
    command.open(root)
        .on('stdout', command.writeTo(process.stdout))
        .on('stderr', command.writeTo(process.stderr))
        .exec('git', ['push', remote, branch])
        .then(function() {
            mainCallback();
        });
};
Пример #5
0
 function(mainCallback) {
     command.open(ROOT)
         .on('stdout', command.writeTo(process.stdout))
         .on('stderr', command.writeTo(process.stderr))
         .exec('git', ['pull', '--rebase', dependency.repo, dependency.version, '--progress'], { cwd: dependency.folder })
         .then(function() {
             mainCallback();
         });
 }],
Пример #6
0
 function(mainCallback) {
     command.open(root)
         .on('stdout', command.writeTo(process.stdout))
         .on('stderr', command.writeTo(process.stdout))
         .exec('git', ['fetch', dependency.repo, dependency.version], { cwd: dependency.folder })
         .then(function() {
             mainCallback();
         });
 },
Пример #7
0
 fsExtra.remove(folderPath, function(err) {
     if (err) {
         command.writeTo(err);
     }
     else {
         command.writeTo('Removed: ' + folder);
         mainCallback();
     }
 });
Пример #8
0
 fsExtra.copy(origin, destination, function(err) {
     if (err) {
         command.writeTo(err);
     }
     else {
         command.writeTo('Copied: ' + fileName);
         callback();
     }
 });
Пример #9
0
exports._gitCurrentBranch = function(mainCallback) {
    command.open(root)
        .on('stdout', command.writeTo(process.stdout))
        .on('stderr', command.writeTo(process.stderr))
        .exec('git', ['symbolic-ref', 'HEAD'])
        .then(function() {
            var data = this.lastOutput.stdout;
            currentBranch = data.substring(data.lastIndexOf('/') + 1).trim();
            mainCallback();
        });
};
Пример #10
0
    exports._gitAddFolder = function(mainCallback) {
        var repo = grunt.config([TASK.name, 'repo']);

        command.open(repo)
            .on('stdout', command.writeTo(process.stdout))
            .on('stderr', command.writeTo(process.stderr))
            .exec('git', ['add', '.'])
            .then(function() {
                mainCallback();
            });
    };
Пример #11
0
    exports._gitCommit = function(mainCallback) {
        var repo = grunt.config([TASK.name, 'repo']);

        command.open(repo)
            .on('stdout', command.writeTo(process.stdout))
            .on('stderr', command.writeTo(process.stderr))
            .exec('git', ['commit', '-m', 'Regenerate API Docs'])
            .then(function() {
                mainCallback();
            });
    };
Пример #12
0
    exports._runYuidoc = function(mainCallback) {
        var auiVersion = grunt.config([TASK.name, 'aui-version']);
        var configFile = path.join(grunt.config([TASK.name, 'theme']), 'yuidoc.json');

        command.open(ROOT)
            .on('stdout', command.writeTo(process.stdout))
            .on('stderr', command.writeTo(process.stderr))
            .exec('yuidoc', ['-c', configFile, '--project-version', auiVersion, '--server'])
            .then(function() {
                mainCallback();
            });
    };
Пример #13
0
    exports._cloneDependency = function(dependency, depCallback) {
        grunt.log.ok('Cloning: ' + dependency.repo +
                ' [' + dependency.version + ']');

        command.open(ROOT)
            .on('stdout', command.writeTo(process.stdout))
            .on('stderr', command.writeTo(process.stderr))
            .exec('git', ['clone', dependency.repo, '-b', dependency.version, dependency.folder, '--progress'], { cwd: ROOT })
            .then(function() {
                depCallback();
            });
    };
Пример #14
0
    exports._gitGoToBranch = function(mainCallback) {
        var branch = grunt.config([TASK.name, 'branch']);
        var repo = grunt.config([TASK.name, 'repo']);

        command.open(repo)
            .on('stdout', command.writeTo(process.stdout))
            .on('stderr', command.writeTo(process.stderr))
            .exec('git', ['checkout', branch])
            .then(function() {
                mainCallback();
            });
    };
Пример #15
0
 exports._runShifter = function(mainCallback, target, args, cwd) {
     command.open(cwd)
         .on('stdout', command.writeTo(process.stdout))
         .on('stderr', command.writeTo(process.stderr))
         .exec('shifter', args)
         .then(function() {
             if (target === 'yui') {
                 exports._setYuiCache(mainCallback, target);
             }
             else {
                 mainCallback();
             }
         });
 };
Пример #16
0
    exports._buildYuidoc = function(mainCallback) {
        var auiVersion = grunt.config([TASK.name, 'aui-version']);
        var configFile = path.join(grunt.config([TASK.name, 'theme']), 'yuidoc.json');
        var sourceDir = grunt.config([TASK.name, 'src']);
        var destinationDir = grunt.config([TASK.name, 'dist']);

        command.open(sourceDir)
            .on('stdout', command.writeTo(process.stdout))
            .on('stderr', command.writeTo(process.stderr))
            .exec('yuidoc', ['-c', configFile, '-o', destinationDir, '--project-version', auiVersion])
            .then(function() {
                mainCallback();
            });
    };
Пример #17
0
    exports._runYogi = function(mainCallback) {
        var args = ['test'];

        if (grunt.config([TASK.name, 'coverage'])) {
            args.push('--coverage');
        }

        command.open(ROOT)
            .on('stdout', command.writeTo(process.stdout))
            .on('stderr', command.writeTo(process.stderr))
            .exec('yogi', args)
            .then(function() {
                mainCallback(this.lastOutput.stdout);
            });
    };
Пример #18
0
exports._gitGoToBranch = function(mainCallback, branch) {
    command.open(root)
        .on('stdout', command.writeTo(process.stdout))
        .exec('git', ['checkout', branch])
        .then(function() {
            mainCallback();
        });
};
Пример #19
0
exports._updateDependency = function(dependency, depCallback) {
    log.info('Updating repo ' + dependency.repo +
                ' [' + dependency.version + ']...');

    command.open(root)
        .on('stdout', command.writeTo(process.stdout))
        .exec('git', ['rebase', 'origin', dependency.version], { cwd: dependency.folder })
        .then(function() {
            depCallback();
        });
};
Пример #20
0
exports._initDependency = function(dependency, depCallback) {
    log.info('Initializing repo ' + dependency.repo +
                ' [' + dependency.version + ']...');

    command.open(root)
        .on('stdout', command.writeTo(process.stdout))
        .exec('git', ['clone', dependency.repo, '-b', dependency.version, dependency.folder], { cwd: root })
        .then(function() {
            depCallback();
        });
};
Пример #21
0
    exports._runYuidoc = function(mainCallback) {
        var auiVersion = grunt.config([TASK.name, 'aui-version']);
        var configFile = path.join(grunt.config([TASK.name, 'theme']), 'yuidoc.json');
        var sourceDirs = grunt.config([TASK.name, 'src']);

        var commandArgs = [];

        sourceDirs.forEach(function(srcDir) {
            commandArgs.push(srcDir);
        });

        commandArgs.push('-c', configFile, '--project-version', auiVersion, '--server');

        command.open(ROOT)
            .on('stdout', command.writeTo(process.stdout))
            .on('stderr', command.writeTo(process.stderr))
            .exec('yuidoc', commandArgs)
            .then(function() {
                mainCallback();
            });
    };
Пример #22
0
 prompt('Do you wish to initialize NPM modules [y/N] ', function(ans) {
     if (ans.toLowerCase().trim() === 'y') {
         command.open(root)
             .on('stdout', command.writeTo(process.stdout))
             .exec('npm', ['install'], { cwd: root })
             .then(function() {
                 mainCallback();
             });
     }
     else {
         mainCallback();
     }
 });
Пример #23
0
    var _build = function() {
        file.mkdir(buildDir);

        var args = ['--build-dir', buildDir, '--replace-version=' + version ];

        if (fast) {
            args.push('--no-lint');
            args.push('--no-coverage');
            args.push('--cache');
        }

        if (walk) {
            args.push('--walk');
        }

        command.open(srcDir)
            .on('stdout', command.writeTo(process.stdout))
            .exec('shifter', args, { cwd: srcDir })
            .then(function() {
                mainCallback();
            });
    };