domchen / depsync Goto Github PK
View Code? Open in Web Editor NEWAutomatically synchronize the dependencies of a project by the DEPS configuration file
License: MIT License
Automatically synchronize the dependencies of a project by the DEPS configuration file
License: MIT License
Executing depsync
for a Git worktree or submodule results in the following Node.js error:
Error: ENOTDIR: not a directory, chmod '/Volumes/data/workspace/repo-worktree/.git/.DEPS.unfinished'
at Object.chmodSync (node:fs:1961:3)
at Object.writeFile (/Users/sample-user/.nvm/versions/node/v20.9.0/lib/node_modules/depsync/src/Utils.js:136:12)
at DepsTask.run (/Users/sample-user/.nvm/versions/node/v20.9.0/lib/node_modules/depsync/src/tasks/DepsTask.js:80:11)
at Object.run (/Users/sample-user/.nvm/versions/node/v20.9.0/lib/node_modules/depsync/src/Program.js:108:14)
at Object. (/Users/sample-user/.nvm/versions/node/v20.9.0/lib/node_modules/depsync/bin/depsync:4:9)
at Module._compile (node:internal/modules/cjs/loader:1241:14)
at Module._extensions..js (node:internal/modules/cjs/loader:1295:10)
at Module.load (node:internal/modules/cjs/loader:1091:32)
at Module._load (node:internal/modules/cjs/loader:938:12)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:83:12) {
errno: -20,
syscall: 'chmod',
code: 'ENOTDIR',
path: '/Volumes/data/workspace/repo-worktree/.git/.DEPS.unfinished'
}
This is caused by the interruption detection feature introduced in 864f10f, released in 1.3.7:
function DepsTask(configFile, version, platform, nonRecursive) {
// ...
this.unfinishFile = path.join(path.dirname(this.configFile), ".git/.DEPS.unfinished");
}
DepsTask.prototype.run = function (callback) {
// ...
Utils.writeFile(this.unfinishFile, "depsync is syncing...");
TaskRunner.runTasks(tasks, () => {
Utils.deletePath(this.unfinishFile);
Utils.deleteEmptyDir(path.dirname(this.unfinishFile));
callback && callback();
});
}
The implementation tries to create file ./.git/.DEPS.unfinished
in order to track the current running task. It assumes that .git
is always a directory, which is not the case for Git worktrees and submodules. In those scenarios, .git
is a file used internally by Git to maintain the relationship between worktrees/submodules and the main repository.
Run the following commands to clone a sample repository and set up a Git worktree.
git clone https://github.com/DL444/depsync-repro.git
cd depsync-repro
git worktree add ../depsync-repro-worktree repro
cd ../depsync-repro-worktree
depsync
Notice that depsync fails on 1.3.7 and later.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.