Comparing version 1.2.8 to 1.3.1
{ | ||
"name": "depsync", | ||
"version": "1.2.8", | ||
"version": "1.3.1", | ||
"author": "Dom Chen", | ||
@@ -5,0 +5,0 @@ "homepage": "http://www.idom.me/", |
@@ -36,3 +36,3 @@ <p align="left"> | ||
{ | ||
"version": "1.2.8", | ||
"version": "1.3.1", | ||
"vars": { | ||
@@ -55,2 +55,11 @@ "GIT_DOMAIN": "github.com", | ||
"dir": "third_party/libjpeg-turbo" | ||
}, | ||
{ | ||
"url": "https://${GIT_DOMAIN}/libpag/tgfx.git", | ||
"commit": "2421ec829090ee61c245249405a4c079f9ecbc11", | ||
"dir": "third_party/tgfx", | ||
"keeps": [ | ||
"third_party", | ||
"vendor_tools" | ||
] | ||
} | ||
@@ -57,0 +66,0 @@ ] |
@@ -94,2 +94,11 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
} | ||
let keeps = item.keeps; | ||
item.keeps = []; | ||
if (keeps instanceof Array) { | ||
for (let keep of keeps) { | ||
keep = formatString(keep, vars); | ||
keep = path.resolve(item.dir, keep); | ||
item.keeps.push(keep); | ||
} | ||
} | ||
list.push(item); | ||
@@ -96,0 +105,0 @@ } |
@@ -71,3 +71,3 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
if (wasShallow !== item.shallow || item.shallow) { | ||
Utils.deletePath(item.dir); | ||
Utils.deletePath(item.dir, item.keeps); | ||
} | ||
@@ -74,0 +74,0 @@ let fetchHeadFile = path.join(item.dir, ".git", "FETCH_HEAD"); |
@@ -74,5 +74,27 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
function deletePath(path) { | ||
function deletePath(filePath, excludes) { | ||
if (!excludes) { | ||
try { | ||
fs.rmSync(filePath, {recursive: true, force: true}); | ||
} catch (e) { | ||
} | ||
return; | ||
} | ||
try { | ||
fs.rmSync(path, { recursive: true, force: true }); | ||
let fileNames = fs.readdirSync(filePath); | ||
for (let name of fileNames) { | ||
let childPath = path.resolve(filePath, name); | ||
let keep = false; | ||
for (let exclude of excludes) { | ||
if (childPath.indexOf(exclude) === 0) { | ||
keep = true; | ||
break; | ||
} | ||
} | ||
if (!keep) { | ||
deletePath(childPath); | ||
} else if (childPath.length !== exclude.length) { | ||
deletePath(childPath, excludes); | ||
} | ||
} | ||
} catch (e) { | ||
@@ -148,5 +170,3 @@ } | ||
let options = { | ||
shell: os.platform() === "win32" ? "cmd.exe" : true, | ||
cwd: dir, | ||
env: process.env | ||
shell: os.platform() === "win32" ? "cmd.exe" : true, cwd: dir, env: process.env | ||
} | ||
@@ -153,0 +173,0 @@ |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
48813
1134
119