Skip to content

Commit

Permalink
check symlinks on main and add output for rm/cp
Browse files Browse the repository at this point in the history
  • Loading branch information
KenCorma committed Oct 27, 2024
1 parent 3ebe45d commit 1cc47f5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scripts/todesktop/afterPack.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@ module.exports = async ({ appOutDir, packager, outDir }) => {

async function removeInvalidSymlinks(appPath) {
const invalidSymlinksInManyLines = await new Promise((resolve, reject) => {
exec(`find ${appPath}/Contents -type l ! -exec test -e {} \\; -print`, (error, stdout, stderr) => {
console.log(`command: find ${appPath}/Contents -type l ! -exec test -e {} \\; -print`)
exec(`find ${appPath} -type l ! -exec test -e {} \\; -print`, (error, stdout, stderr) => {
console.log(`command: find ${appPath} -type l ! -exec test -e {} \\; -print`)
if (error) {
console.error(`error: ${error.message}`);
return reject(error);
Expand Down Expand Up @@ -77,9 +77,11 @@ module.exports = async ({ appOutDir, packager, outDir }) => {
const mainPath = path.dirname(outDir);
const assetPath = path.join(mainPath, 'app-wrapper', 'app', 'assets');
const resourcePath = path.join(appPath, "Contents", "Resources");
await fs.rm(path.join(assetPath, "ComfyUI", ".git"), { recursive: true, force: true });
await fs.cp(assetPath, resourcePath, { recursive: true });
await removeInvalidSymlinks(appPath);
const result = await fs.rm(path.join(assetPath, "ComfyUI", ".git"), { recursive: true, force: true });
const result2 = await fs.cp(assetPath, resourcePath, { recursive: true });
console.log("rm" , result);
console.log("cp" , result2);
await removeInvalidSymlinks(mainPath);
}

if (os.platform() === 'win32') {
Expand Down

0 comments on commit 1cc47f5

Please sign in to comment.