Skip to content

Commit

Permalink
look in target-specific release folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Brendonovich committed Dec 6, 2024
1 parent 37206e7 commit c8925b5
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions apps/desktop/scripts/stripDebugSymbols.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,18 +6,33 @@ import { promisify } from "node:util";

const exec = promisify(execCb);

console.log(process.env);

const __filename = fileURLToPath(import.meta.url);
const __dirname = path.dirname(__filename);

const targetDir = path.join(__dirname, "../../../target");
const releaseDir = path.join(targetDir, "release");

async function main() {
const dirs = [];
const releaseDir = path.join(targetDir, "release");
const releaseFiles = await fs.readdir(releaseDir);
const binaryPath = path.join(
releaseDir,
releaseFiles.find((f) => f.startsWith("Cap"))
);
let releaseFile = releaseFiles.find((f) => f.startsWith("Cap"));
dirs.push(releaseDir);

if (!releaseFile) {
const releaseDir = path.join(
targetDir,
`release/${process.env.TAURI_ENV_TARGET_TRIPLE}`
);
dirs.push(releaseDir);
const releaseFiles = await fs.readdir(releaseDir);
releaseFile = releaseFiles.find((f) => f.startsWith("Cap"));
}

if (!releaseFile) throw new Error(`No binary found at ${dirs.join(", ")}`);

const binaryPath = path.join(releaseDir, releaseFile);

await exec(`dsymutil "${binaryPath}" -o "${binaryPath}.dSYM"`);
await exec(`strip "${binaryPath}"`);
Expand Down

1 comment on commit c8925b5

@vercel
Copy link

@vercel vercel bot commented on c8925b5 Dec 6, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.