lib/jobs.js
function publishRobotsTxt () {
    var path = 'robots.txt';
    return fs
        .statAsync(path)
        .then(function (pStat) {
            if (!pStat.isFile()) {
                // go to our default course of action, that is create robots.txt file
                throw new Error ();
            }
        })
        .catch(Error, function () {
            return fs
                .openAsync(path, 'w')
                .then(function () {
                    return fs.writeFileAsync(path, 'User-agent: *\nSitemap: ' + config.siteUrl + '/sitemap.xml');
                })
                .catch(function (pErr) {
                    log.error(pErr);
                });
        });
}
function publishRobotsTxt () {
    var path = 'robots.txt';
    return fs
        .statAsync(path)
        .then(function (pStat) {
            if (!pStat.isFile()) {
                // go to our default course of action, that is create robots.txt file
                throw new Error ();
            }
        })
        .catch(Error, function () {
            return fs
                .openAsync(path, 'w')
                .then(function () {
                    return fs.writeFileAsync(path, 'User-agent: *\nSitemap: ' + config.siteUrl + '/sitemap.xml');
                })
                .catch(function (pErr) {
                    log.error(pErr);
                });
        });
}
function publishRobotsTxt ( ) { var path = 'robots.txt' ; return fs . statAsync ( path ) . then ( function ( pStat ) { if ( ! pStat . isFile ( ) ) { // go to our default course of action, that is create robots.txt file throw new Error ( ) ; } } ) . catch ( Error , function ( ) { return fs . openAsync ( path , 'w' ) . then ( function ( ) { return fs . writeFileAsync ( path , 'User-agent: *\nSitemap: ' + config . siteUrl + '/sitemap.xml' ) ; } ) . catch ( function ( pErr ) { log . error ( pErr ) ; } ) ; } ) ; }
Creates a default robots.txt file if it does not exist
@returns {*}
Creates a default robots . txt file if it does not exist