mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 21:03:08 +00:00
fix(platform): remove logger import to avoid circular dependency
Replace createLogger with console.warn to prevent circular import between @automaker/platform and @automaker/utils. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -13,23 +13,12 @@ import { homedir } from 'os';
|
|||||||
import { join } from 'path';
|
import { join } from 'path';
|
||||||
import { access } from 'fs/promises';
|
import { access } from 'fs/promises';
|
||||||
import type { EditorInfo } from '@automaker/types';
|
import type { EditorInfo } from '@automaker/types';
|
||||||
import { createLogger } from '@automaker/utils';
|
|
||||||
|
|
||||||
const execFileAsync = promisify(execFile);
|
const execFileAsync = promisify(execFile);
|
||||||
|
|
||||||
// Platform detection
|
// Platform detection
|
||||||
const isWindows = process.platform === 'win32';
|
const isWindows = process.platform === 'win32';
|
||||||
const isMac = process.platform === 'darwin';
|
const isMac = process.platform === 'darwin';
|
||||||
|
|
||||||
// Lazy-initialized logger for editor detection
|
|
||||||
let logger: ReturnType<typeof createLogger> | null = null;
|
|
||||||
function getLogger() {
|
|
||||||
if (!logger) {
|
|
||||||
logger = createLogger('editor');
|
|
||||||
}
|
|
||||||
return logger;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Cache with TTL for editor detection
|
// Cache with TTL for editor detection
|
||||||
let cachedEditors: EditorInfo[] | null = null;
|
let cachedEditors: EditorInfo[] | null = null;
|
||||||
let cacheTimestamp: number = 0;
|
let cacheTimestamp: number = 0;
|
||||||
@@ -158,7 +147,7 @@ async function isXcodeFullyInstalled(): Promise<boolean> {
|
|||||||
const xcodeAppPath = await findMacApp('Xcode');
|
const xcodeAppPath = await findMacApp('Xcode');
|
||||||
|
|
||||||
if (xedExists && xcodeAppPath) {
|
if (xedExists && xcodeAppPath) {
|
||||||
getLogger().warn(
|
console.warn(
|
||||||
'Xcode is installed but xcode-select is pointing to Command Line Tools. ' +
|
'Xcode is installed but xcode-select is pointing to Command Line Tools. ' +
|
||||||
'To use Xcode as an editor, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer'
|
'To use Xcode as an editor, run: sudo xcode-select --switch /Applications/Xcode.app/Contents/Developer'
|
||||||
);
|
);
|
||||||
|
|||||||
Reference in New Issue
Block a user