-
-
Notifications
You must be signed in to change notification settings - Fork 18
Closed
Description
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.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels