[hotfix] When clone version, copy junction link and not copy their content

This commit is contained in:
MathieuG-P
2023-03-20 00:29:21 +01:00
parent b9acdc9578
commit d3e0099d14
2 changed files with 24 additions and 4 deletions
@@ -5,7 +5,6 @@ import { SteamService } from "./steam.service";
import { BS_APP_ID, OCULUS_BS_DIR } from "../constants";
import path from "path";
import { createReadStream } from "fs";
import fs from "fs-extra";
import { ConfigurationService } from "./configuration.service";
import { rename } from "fs/promises";
import { BsmException } from "shared/models/bsm-exception.model";
@@ -13,7 +12,7 @@ import log from "electron-log";
import { OculusService } from "./oculus.service";
import { DownloadLinkType } from "shared/models/mods";
import sanitize from "sanitize-filename";
import { deleteFolder, getFoldersInFolder, pathExist } from "../helpers/fs.helpers";
import { copyDirectoryWithJunctions, deleteFolder, getFoldersInFolder, pathExist } from "../helpers/fs.helpers";
import { FolderLinkerService } from "./folder-linker.service";
export class BSLocalVersionService{
@@ -223,7 +222,7 @@ export class BSLocalVersionService{
if(await pathExist(newPath)){ throw {title: "VersionAlreadExist"} as BsmException; }
return fs.copy(originPath, newPath, {dereference: true}).then(() => {
return copyDirectoryWithJunctions(originPath, newPath).then(() => {
this.addCustomVersion(cloneVersion);
return cloneVersion;
}).catch((err: Error) => {