lib/fs.js
function() {
        var items = _utils.getArgArray(arguments);
        if (items.length === 0) {
            throw new Error('no files specified to create');
        }
        items.forEach(function(item) {
            var contents;
            var linkTarget;
            var filePath;
            if (typeof item === 'object') {
                filePath = item.path;
                contents = item.contents || '';
                linkTarget = item.linkTo;
            } else if (typeof item === 'string') {
                filePath = item;
                contents = '';
            }
            if (typeof filePath !== 'string' || filePath.length === 0) {
                throw new Error('file path not specified');
            }

            contents = contents || '';
            try {
                if (!!linkTarget) {
                    _fs.symlinkSync(linkTarget, filePath);
                } else {
                    _fs.writeFileSync(filePath, contents);
                }
            } catch (e) {
                // Eat the exception.
            }
        });
    }
function() {
        var items = _utils.getArgArray(arguments);
        if (items.length === 0) {
            throw new Error('no files specified to create');
        }
        items.forEach(function(item) {
            var contents;
            var linkTarget;
            var filePath;
            if (typeof item === 'object') {
                filePath = item.path;
                contents = item.contents || '';
                linkTarget = item.linkTo;
            } else if (typeof item === 'string') {
                filePath = item;
                contents = '';
            }
            if (typeof filePath !== 'string' || filePath.length === 0) {
                throw new Error('file path not specified');
            }

            contents = contents || '';
            try {
                if (!!linkTarget) {
                    _fs.symlinkSync(linkTarget, filePath);
                } else {
                    _fs.writeFileSync(filePath, contents);
                }
            } catch (e) {
                // Eat the exception.
            }
        });
    }
function ( ) { var items = _utils . getArgArray ( arguments ) ; if ( items . length === 0 ) { throw new Error ( 'no files specified to create' ) ; } items . forEach ( function ( item ) { var contents ; var linkTarget ; var filePath ; if ( typeof item === 'object' ) { filePath = item . path ; contents = item . contents || '' ; linkTarget = item . linkTo ; } else if ( typeof item === 'string' ) { filePath = item ; contents = '' ; } if ( typeof filePath !== 'string' || filePath . length === 0 ) { throw new Error ( 'file path not specified' ) ; } contents = contents || '' ; try { if ( ! ! linkTarget ) { _fs . symlinkSync ( linkTarget , filePath ) ; } else { _fs . writeFileSync ( filePath , contents ) ; } } catch ( e ) { // Eat the exception. } } ) ; }
Creates all of the files specified in the array.
Creates all of the files specified in the array .