var _interopRequireDefault=require("@babel/runtime/helpers/interopRequireDefault");Object.defineProperty(exports,"__esModule",{value:true});exports.default=exports.taskRnvLink=void 0;var _regenerator=_interopRequireDefault(require("@babel/runtime/regenerator"));var _path=_interopRequireDefault(require("path"));
var _resolve=require("../core/resolve");
var _logger=require("../core/systemManager/logger");
var _constants=require("../core/constants");
var _fileutils=require("../core/systemManager/fileutils");



var taskRnvLink=function taskRnvLink(c){var l;return _regenerator.default.async(function taskRnvLink$(_context){while(1){switch(_context.prev=_context.next){case 0:
(0,_logger.logTask)('taskRnvLink');

if((0,_fileutils.fsExistsSync)(c.paths.project.npmLinkPolyfill)){
l=JSON.parse(
(0,_fileutils.fsReadFileSync)(c.paths.project.npmLinkPolyfill).toString());

Object.keys(l).forEach(function(key){
var source=_path.default.resolve(l[key]);
var nm=_path.default.join(source,'node_modules');
var dest=(0,_resolve.doResolve)(key);
if((0,_fileutils.fsExistsSync)(source)){
(0,_fileutils.copyFolderContentsRecursiveSync)(source,dest,false,[nm]);
}else{
(0,_logger.logWarning)("Source: "+source+" doesn't exists!");
}
});
}else{
(0,_logger.logWarning)(
c.paths.project.npmLinkPolyfill+" file not found. nothing to link!");

}return _context.abrupt("return",
true);case 3:case"end":return _context.stop();}}},null,null,null,Promise);};exports.taskRnvLink=taskRnvLink;var _default=


{
description:'',
fn:taskRnvLink,
task:'link',
params:_constants.PARAMS.withBase(),
platforms:[],
skipPlatforms:true};exports.default=_default;
//# sourceMappingURL=task.rnv.link.js.map