Skip to content

Commit ee9e168

Browse files
authored
feat: customize binary path (#300)
* feat: customize binary path * fix: TS/eslint issues
1 parent f6c097a commit ee9e168

File tree

1 file changed

+3
-7
lines changed

1 file changed

+3
-7
lines changed

packages/platforms/android/src/commands/platforms/UnixProfiler.ts

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -22,13 +22,9 @@ import { processOutput as processRamOutput } from "../ram/pollRamUsage";
2222

2323
export const CppProfilerName = `BAMPerfProfiler`;
2424

25-
// Since Flipper uses esbuild, we copy the bin folder directly
26-
// into the Flipper plugin directory
27-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
28-
// @ts-expect-error
29-
const binaryFolder = global.Flipper
30-
? `${__dirname}/bin`
31-
: `${__dirname}/../../..${__dirname.includes("dist") ? "/.." : ""}/cpp-profiler/bin`;
25+
const defaultBinaryFolder = `${__dirname}/../../..${__dirname.includes("dist") ? "/.." : ""}/cpp-profiler/bin`;
26+
// Allow overriding the binary folder with an environment variable
27+
const binaryFolder = process.env.FLASHLIGHT_BINARY_PATH || defaultBinaryFolder;
3228

3329
export abstract class UnixProfiler implements Profiler {
3430
stop(): void {

0 commit comments

Comments
 (0)