Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

depsync

Package Overview
Dependencies
Maintainers
1
Versions
44
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

depsync - npm Package Compare versions

Comparing version 1.3.2 to 1.3.7

src/tasks/SubRepoTask.js

2

package.json
{
"name": "depsync",
"version": "1.3.2",
"version": "1.3.7",
"author": "Dom Chen",

@@ -5,0 +5,0 @@ "homepage": "http://www.idom.me/",

@@ -33,2 +33,3 @@ //////////////////////////////////////////////////////////////////////////////////////

const ActionTask = require("./ActionTask");
const SubRepoTask = require("./SubRepoTask");
const TaskRunner = require("./TaskRunner");

@@ -42,2 +43,3 @@ const path = require("path");

this.nonRecursive = nonRecursive;
this.unfinishFile = path.join(path.dirname(this.configFile), ".git/.DEPS.unfinished");
}

@@ -62,4 +64,10 @@

}
let repoDirty = false;
if (commit !== item.commit || wasShallow !== item.shallow) {
repoDirty = true;
tasks.push(new RepoTask(item));
}
if (repoDirty || fs.existsSync(this.unfinishFile)) {
let subRepoTask = new SubRepoTask(item);
tasks.push(subRepoTask);
if (!this.nonRecursive) {

@@ -80,4 +88,9 @@ let depsFile = path.join(item.dir, "DEPS");

}
let item = {dir: path.dirname(this.configFile)};
let subRepoTask = new SubRepoTask(item);
tasks.push(subRepoTask);
Utils.writeFile(this.unfinishFile, "depsync is syncing...");
TaskRunner.runTasks(tasks, () => {
Utils.deletePath(this.unfinishFile);
Utils.deleteEmptyDir(path.dirname(this.unfinishFile));
callback && callback();

@@ -84,0 +97,0 @@ });

@@ -29,2 +29,3 @@ //////////////////////////////////////////////////////////////////////////////////////

const fs = require('fs');
const os = require('os')
const Utils = require("../Utils");

@@ -82,9 +83,7 @@

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);
}
process.env["GIT_LFS_SKIP_SMUDGE"]="1";
Utils.exec("git reset --hard FETCH_HEAD", item.dir);
callback && callback();

@@ -91,0 +90,0 @@ };

@@ -168,4 +168,11 @@ //////////////////////////////////////////////////////////////////////////////////////

function exec(cmd, dir, quiet) {
if (!dir) {
dir = process.cwd();
} else {
dir = path.resolve(dir);
}
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
}

@@ -187,2 +194,22 @@

function execSafe(cmd, dir) {
if (!dir) {
dir = process.cwd();
} else {
dir = path.resolve(dir);
}
let options = {
shell: os.platform() === "win32" ? "cmd.exe" : true,
cwd: dir,
env: process.env
}
try {
let result = childProcess.spawnSync(cmd, options);
return result.stdout.toString();
} catch (e) {
return "";
}
}
function addLineBreaker() {

@@ -198,4 +225,5 @@ hasLineBreaker = true;

exports.exec = exec;
exports.execSafe = execSafe;
exports.log = log;
exports.error = error;
exports.addLineBreaker = addLineBreaker;
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc