|
@@ -51,12 +51,16 @@ function isZipFile($fileName){
|
|
}
|
|
}
|
|
//获取 gopeed.exe 路径
|
|
//获取 gopeed.exe 路径
|
|
function getGoPeedPath($toolDir){
|
|
function getGoPeedPath($toolDir){
|
|
- return pathJoin($toolDir,"gopeed.exe");
|
|
|
|
|
|
+ if(!$toolDir)
|
|
|
|
+ return 'gopeed.exe';
|
|
|
|
+ return pathJoin($toolDir,'gopeed.exe');
|
|
}
|
|
}
|
|
|
|
|
|
//获取 7z.exe 路径
|
|
//获取 7z.exe 路径
|
|
function get7ZipPath($toolDir){
|
|
function get7ZipPath($toolDir){
|
|
- return pathJoin($toolDir,"7z.exe");
|
|
|
|
|
|
+ if(!$toolDir)
|
|
|
|
+ return '7z.exe';
|
|
|
|
+ return pathJoin($toolDir,'7z.exe');
|
|
}
|
|
}
|
|
//两个参数的路径拼接
|
|
//两个参数的路径拼接
|
|
function twoPathJoin($base, $path) {
|
|
function twoPathJoin($base, $path) {
|
|
@@ -148,7 +152,15 @@ function loadRepoConfigs($vendorDir,$repoNames){
|
|
}
|
|
}
|
|
return $configs;
|
|
return $configs;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+//默认配置信息
|
|
|
|
+function defaultConfig($cfgPath){
|
|
|
|
+ return array(
|
|
|
|
+ 'distribute-mode' => 'install',
|
|
|
|
+ 'cache-dir' => 'd:/dist-cache/',
|
|
|
|
+ 'tool-dir' => '',
|
|
|
|
+ 'oss-host' => 'http://distribute-helper.oss-cn-hangzhou.aliyuncs.com',
|
|
|
|
+ );
|
|
|
|
+}
|
|
//解析部署配置文件
|
|
//解析部署配置文件
|
|
function loadConfig($cfgPath){
|
|
function loadConfig($cfgPath){
|
|
$config = json_decode(file_get_contents($cfgPath), true);
|
|
$config = json_decode(file_get_contents($cfgPath), true);
|