Comparing version 1.2.7 to 1.2.8
{ | ||
"name": "depsync", | ||
"version": "1.2.7", | ||
"version": "1.2.8", | ||
"author": "Dom Chen", | ||
@@ -5,0 +5,0 @@ "homepage": "http://www.idom.me/", |
@@ -36,3 +36,3 @@ <p align="left"> | ||
{ | ||
"version": "1.2.2", | ||
"version": "1.2.8", | ||
"vars": { | ||
@@ -48,3 +48,4 @@ "GIT_DOMAIN": "github.com", | ||
"commit": "1fe3162541ab2f5ce69aca2e2b593fab60520d34", | ||
"dir": "third_party/libwebp" | ||
"dir": "third_party/libwebp", | ||
"shallow": false | ||
}, | ||
@@ -51,0 +52,0 @@ { |
@@ -87,2 +87,9 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
item.dir = path.resolve(projectPath, item.dir); | ||
let shallow = item.shallow; | ||
if (typeof shallow == "string") { | ||
shallow = formatString(shallow, vars); | ||
item.shallow = (shallow !== "false"); | ||
} else if (typeof shallow != "boolean") { | ||
item.shallow = true; | ||
} | ||
list.push(item); | ||
@@ -89,0 +96,0 @@ } |
@@ -52,4 +52,6 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
let shallowFile = path.join(item.dir, ".git", "shallow"); | ||
let commit = Utils.readFile(shallowFile).substr(0, 40); | ||
if (commit !== item.commit) { | ||
let wasShallow = fs.existsSync(shallowFile); | ||
let fetchHeadFile = path.join(item.dir, ".git", "FETCH_HEAD"); | ||
let commit = Utils.readFile(fetchHeadFile).substr(0, 40); | ||
if (commit !== item.commit || wasShallow !== item.shallow) { | ||
tasks.push(new RepoTask(item)); | ||
@@ -56,0 +58,0 @@ if (!this.nonRecursive) { |
@@ -28,2 +28,3 @@ ////////////////////////////////////////////////////////////////////////////////////// | ||
const path = require('path'); | ||
const fs = require('fs'); | ||
const Utils = require("../Utils"); | ||
@@ -64,4 +65,2 @@ | ||
Utils.log("【depsync】checking out repository: " + name + "@" + item.commit); | ||
Utils.deletePath(item.dir); | ||
Utils.createDirectory(item.dir); | ||
let url = item.url; | ||
@@ -71,7 +70,22 @@ if (this.username && this.password) { | ||
} | ||
Utils.exec("git init -q", item.dir); | ||
Utils.exec("git remote add origin " + url, item.dir); | ||
Utils.exec("git fetch --depth 1 origin " + item.commit, item.dir); | ||
Utils.exec("git reset --hard FETCH_HEAD -q", item.dir); | ||
Utils.exec("git submodule update --quiet --init --recursive --depth=1", item.dir, false); | ||
let shallowFile = path.join(item.dir, ".git", "shallow"); | ||
let wasShallow = fs.existsSync(shallowFile); | ||
if (wasShallow !== item.shallow || item.shallow) { | ||
Utils.deletePath(item.dir); | ||
} | ||
let fetchHeadFile = path.join(item.dir, ".git", "FETCH_HEAD"); | ||
if (!fs.existsSync(fetchHeadFile)) { | ||
Utils.createDirectory(item.dir); | ||
Utils.exec("git init -q", item.dir); | ||
Utils.exec("git remote add origin " + url, item.dir); | ||
} | ||
if (item.shallow) { | ||
Utils.exec("git fetch --depth 1 origin " + item.commit, item.dir); | ||
Utils.exec("git reset --hard FETCH_HEAD -q", item.dir); | ||
Utils.exec("git submodule update --quiet --init --recursive --depth=1", item.dir, false); | ||
} else { | ||
Utils.exec("git fetch origin " + item.commit, item.dir); | ||
Utils.exec("git reset --hard FETCH_HEAD -q", item.dir); | ||
Utils.exec("git submodule update --quiet --init --recursive", item.dir, false); | ||
} | ||
callback && callback(); | ||
@@ -78,0 +92,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
47345
1105
110
11