'use strict';

const gulp = require('gulp');
const fs   = require('fs');

var m = require('../common.js');
var buildConfig = m.config.buildConfig;

m.vendorDir = buildConfig.publicDir + '/vendor';
gulp.task("vendor", done => {
    if (!fs.existsSync(buildConfig.publicDir)) {
        fs.mkdirSync(buildConfig.publicDir);
    }

    if(!fs.existsSync(m.vendorDir)) {
        fs.mkdirSync(m.vendorDir);
        logger.info('Vendor directory created at: ' + m.vendorDir);
    } else {
        logger.info('Vendor directory already exists!');
    }

    done();
});