mirror of
https://github.com/openai/codex.git
synced 2026-05-02 04:11:39 +03:00
fix: remove unnecessary isLoggingEnabled() checks (#420)
It appears that use of `isLoggingEnabled()` was erroneously copypasta'd in many places. This PR updates its docstring to clarify that should only be used to avoid constructing a potentially expensive docstring. With this change, the only function that merits/uses this check is `execCommand()`. --- [//]: # (BEGIN SAPLING FOOTER) Stack created with [Sapling](https://sapling-scm.com). Best reviewed with [ReviewStack](https://reviewstack.dev/openai/codex/pull/420). * #423 * __->__ #420 * #419
This commit is contained in:
@@ -2,7 +2,7 @@
|
||||
* Utility functions for handling platform-specific commands
|
||||
*/
|
||||
|
||||
import { log, isLoggingEnabled } from "./log.js";
|
||||
import { log } from "./log.js";
|
||||
|
||||
/**
|
||||
* Map of Unix commands to their Windows equivalents
|
||||
@@ -59,9 +59,7 @@ export function adaptCommandForPlatform(command: Array<string>): Array<string> {
|
||||
return command;
|
||||
}
|
||||
|
||||
if (isLoggingEnabled()) {
|
||||
log(`Adapting command '${cmd}' for Windows platform`);
|
||||
}
|
||||
log(`Adapting command '${cmd}' for Windows platform`);
|
||||
|
||||
// Create a new command array with the adapted command
|
||||
const adaptedCommand = [...command];
|
||||
@@ -78,9 +76,7 @@ export function adaptCommandForPlatform(command: Array<string>): Array<string> {
|
||||
}
|
||||
}
|
||||
|
||||
if (isLoggingEnabled()) {
|
||||
log(`Adapted command: ${adaptedCommand.join(" ")}`);
|
||||
}
|
||||
log(`Adapted command: ${adaptedCommand.join(" ")}`);
|
||||
|
||||
return adaptedCommand;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user