web designer: guard ignores uploaded media assets (app/public/media)
This commit is contained in:
parent
50f6db55d8
commit
364fd1b425
1 changed files with 8 additions and 1 deletions
|
|
@ -493,8 +493,15 @@ async function runDesignTask(task) {
|
|||
|
||||
// Pre-flight: the auto-publish commit is scoped to GIT_SCOPE, so a dirty tree
|
||||
// would get swept into this task's commit. Refuse rather than clobber WIP.
|
||||
// Uploaded assets under app/public/media/ are expected (they're this task's
|
||||
// images) and get committed with it, so they don't count as "dirty".
|
||||
const pre = await git(["status", "--porcelain", "--", ...GIT_SCOPE]);
|
||||
if (pre.tail.trim() !== "") {
|
||||
const dirty = pre.tail
|
||||
.split("\n")
|
||||
.map((l) => l.slice(3).trim()) // strip the "XY " status prefix
|
||||
.filter(Boolean)
|
||||
.filter((p) => !p.startsWith("app/public/media/"));
|
||||
if (dirty.length) {
|
||||
return { ok: false, error: "Working tree wasn't clean — commit or discard pending changes before running the queue." };
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue