fix: resolve publish lock in git worktree
This commit is contained in:
parent
423aff6519
commit
4ff84ac677
2 changed files with 3 additions and 2 deletions
|
|
@ -70,7 +70,8 @@ export function validateCurrentTcsBinding(stateDirectory, expectedSession = proc
|
|||
}
|
||||
|
||||
function acquireCurrentPublishLock(worktree, developmentId, binding) {
|
||||
const lockPath = path.join(worktree, ".git", "guanghu-current-tcs-publish.lock");
|
||||
const gitDirectory = path.resolve(worktree, git(worktree, ["rev-parse", "--git-dir"]));
|
||||
const lockPath = path.join(gitDirectory, "guanghu-current-tcs-publish.lock");
|
||||
const descriptor = fs.openSync(lockPath, "wx", 0o600);
|
||||
fs.writeFileSync(descriptor, `${JSON.stringify({ development_id: developmentId, binding, created_at: new Date().toISOString() })}\n`);
|
||||
return { descriptor, lockPath };
|
||||
|
|
|
|||
Loading…
Reference in a new issue