
'use strict';

const path = require('path');

module.exports = (() => {
    // const akasha = require('../index');
    const Command = require('cmnd').Command;
    
    class CopyAssetsCommand extends Command {
    
        constructor() {
            super('copy-assets');
        }
      
        help() {
            return {
                description: 'Copy assets into output directory',
                args: [ 'config_file' ],
            };
        }
        
        run(args, flags, vflags, callback) {
            
            const config = require(path.join(__dirname, args[0]));

            config.copyAssets()
            .then(() => { callback(null); })
            .catch(err => { callback(err); });
    
        }
    }

    return CopyAssetsCommand;

})();

'use strict';

const path = require('path');

module.exports = (() => {
    // const akasha = require('../index');
    const Command = require('cmnd').Command;
    
    class CopyAssetsCommand extends Command {
    
        constructor() {
            super('copy-assets');
        }
      
        help() {
            return {
                description: 'Copy assets into output directory',
                args: [ 'config_file' ],
            };
        }
        
        run(args, flags, vflags, callback) {

            if (!args[0]) callback(new Error("copy-assets: no config file name given"));
            
            const config = require(path.join(__dirname, args[0]));

            config.copyAssets()
            .then(() => { callback(null); })
            .catch(err => { callback(err); });
    
        }
    }

    return CopyAssetsCommand;

})();
Check for missing config file name
Check for missing config file name

