"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var child_process_1=require("child_process"),fs_1=require("fs"),path_1=require("path"),utils_1=require("../../lib/utils");function default_1(e){function o(){(t=child_process_1.spawn("node",[path_1.join(__dirname,"./subprocess"),i,s,n],{stdio:"inherit"})).on("close",function(e){return e&&u.close()})}var t,r,e=e.options||{},i=e.host||"localhost",s=e.port||9e3,n=e.resconfigPath||"/resconfig.json",e=utils_1.getEnvironment().workspaceRoot;if(!e)throw Error("请在 NgCortex 工程目录中操作！");var u=fs_1.watch(path_1.join(e,"./mock"),{recursive:!0},function(){clearTimeout(r),r=setTimeout(function(){t&&(t.exitCode?setTimeout(o):(t.on("exit",o),t.kill()),t=null)},500)});o()}exports.default=default_1;
