fix: restore current in-place project files

This commit is contained in:
muena
2026-10-06 13:17:18 +02:00
parent 43fbf46014
commit 0ec5b0745e
3 changed files with 28 additions and 3 deletions

View File

@@ -318,8 +318,10 @@ export function runCopiesPath(run: ProjectRun, directory: string): string {
export async function scanRestorableCopyFiles(run: ProjectRun, directory: string, current = true): Promise<{
root: string; files: ProjectFile[]; skipped: number;
}> {
let root = current ? runCopiesPath(run, directory) : join(directory, "files");
if (current && run.copyPath) {
const inPlace = Boolean(run.inPlace || run.sourceInPlace);
let root = current && inPlace ? canonicalProjectPath(run.projectPath)
: current ? runCopiesPath(run, directory) : join(directory, "files");
if (current && !inPlace && run.copyPath) {
try {
if (!(await fs.lstat(root)).isDirectory()) throw new Error("Kopienpfad ist kein regulärer Ordner.");
} catch (error) {