Summary
The pattern of detecting an executable and invoking it with commands is repeated across many targets. This should be abstracted into a helper utility.
Current Pattern
const executable = await findExecutable(BIN, customBin);
if (!executable) {
throw new ConfigurationError(`Cannot find '${BIN}' for publishing.`);
}
await spawnProcess(executable, [...args]);
Proposed Solution
Create a helper like:
interface ExecutableConfig {
binName: string;
customBinEnvVar?: string;
errorContext: string;
}
async function runWithExecutable(
config: ExecutableConfig,
args: string[],
options?: SpawnOptions
): Promise<Buffer>;
Affected Targets
- npm
- pypi
- crates
- gem
- pub-dev
- hex
- nuget
- Others
Related
Spawned from PR #707 review comment.
Summary
The pattern of detecting an executable and invoking it with commands is repeated across many targets. This should be abstracted into a helper utility.
Current Pattern
Proposed Solution
Create a helper like:
Affected Targets
Related
Spawned from PR #707 review comment.