Comparing version 1.3.8 to 1.3.11
{ | ||
"name": "depsync", | ||
"version": "1.3.8", | ||
"version": "1.3.11", | ||
"author": "Dom Chen", | ||
@@ -5,0 +5,0 @@ "homepage": "http://www.idom.me/", |
@@ -70,7 +70,5 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
let lfsDir = path.join(item.dir, ".git", "lfs"); | ||
let indexFile = path.join(item.dir, ".git", "index"); | ||
let tempLFSDir = path.join(item.dir + ".git", "lfs"); | ||
let tempIndexFile = path.join(item.dir + ".git", "index"); | ||
let lfsBakDir = path.join(item.dir, ".git", "lfs.bak"); | ||
let tempLFSDir = path.join(item.dir, ".lfs.bak"); | ||
Utils.movePath(lfsDir, tempLFSDir); | ||
Utils.movePath(indexFile, tempIndexFile); | ||
Utils.deletePath(path.join(item.dir, ".git")); | ||
@@ -83,13 +81,5 @@ if (!fs.existsSync(item.dir)) { | ||
Utils.exec("git fetch --depth 1 origin " + item.commit, item.dir); | ||
Utils.movePath(tempLFSDir, lfsDir); | ||
Utils.movePath(tempIndexFile, indexFile); | ||
Utils.deleteEmptyDir(path.dirname(tempIndexFile)); | ||
Utils.movePath(tempLFSDir, lfsBakDir); | ||
process.env["GIT_LFS_SKIP_SMUDGE"] = "1"; | ||
Utils.exec("git reset --hard FETCH_HEAD && git clean -f -q", item.dir); | ||
let shallowFile = path.join(item.dir, ".git", "shallow"); | ||
Utils.writeFile(shallowFile, item.commit + "\n"); | ||
let lfsConfig = path.join(item.dir, ".gitattributes"); | ||
if (fs.existsSync(lfsConfig)) { | ||
Utils.exec("git lfs prune", item.dir); | ||
} | ||
callback && callback(); | ||
@@ -96,0 +86,0 @@ }; |
@@ -57,3 +57,9 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
Utils.log("【depsync】downloading git lfs objects to: " + repoPath); | ||
Utils.exec("git lfs pull", repoPath, false); | ||
let lfsDir = path.join(repoPath, ".git", "lfs"); | ||
let lfsBakDir = path.join(repoPath, ".git", "lfs.bak"); | ||
if (fs.existsSync(lfsBakDir)) { | ||
Utils.deletePath(lfsDir); | ||
Utils.movePath(lfsBakDir, lfsDir); | ||
} | ||
Utils.exec("git lfs pull && git lfs prune", repoPath, false); | ||
} | ||
@@ -60,0 +66,0 @@ } |
@@ -104,2 +104,4 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
function movePath(srcPath, dstPath) { | ||
srcPath = path.resolve(srcPath); | ||
dstPath = path.resolve(dstPath); | ||
if (!fs.existsSync(srcPath)) { | ||
@@ -109,8 +111,5 @@ return; | ||
try { | ||
createDirectory(path.dirname(dstPath)); | ||
fs.renameSync(srcPath, dstPath); | ||
} catch (e) { | ||
if (e.code === "EXDEV") { | ||
copyPath(srcPath, dstPath); | ||
deletePath(srcPath); | ||
} | ||
} | ||
@@ -117,0 +116,0 @@ } |
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
51958
1226