From ee9e168b81a96ec60be6ced43633b4b59ab55afe Mon Sep 17 00:00:00 2001 From: Kirill Zyusko Date: Wed, 17 Jul 2024 18:50:03 +0200 Subject: [PATCH] feat: customize binary path (#300) * feat: customize binary path * fix: TS/eslint issues --- .../android/src/commands/platforms/UnixProfiler.ts | 10 +++------- 1 file changed, 3 insertions(+), 7 deletions(-) diff --git a/packages/platforms/android/src/commands/platforms/UnixProfiler.ts b/packages/platforms/android/src/commands/platforms/UnixProfiler.ts index ccacf09c..be26fe66 100644 --- a/packages/platforms/android/src/commands/platforms/UnixProfiler.ts +++ b/packages/platforms/android/src/commands/platforms/UnixProfiler.ts @@ -22,13 +22,9 @@ import { processOutput as processRamOutput } from "../ram/pollRamUsage"; export const CppProfilerName = `BAMPerfProfiler`; -// Since Flipper uses esbuild, we copy the bin folder directly -// into the Flipper plugin directory -// eslint-disable-next-line @typescript-eslint/ban-ts-comment -// @ts-expect-error -const binaryFolder = global.Flipper - ? `${__dirname}/bin` - : `${__dirname}/../../..${__dirname.includes("dist") ? "/.." : ""}/cpp-profiler/bin`; +const defaultBinaryFolder = `${__dirname}/../../..${__dirname.includes("dist") ? "/.." : ""}/cpp-profiler/bin`; +// Allow overriding the binary folder with an environment variable +const binaryFolder = process.env.FLASHLIGHT_BINARY_PATH || defaultBinaryFolder; export abstract class UnixProfiler implements Profiler { stop(): void {