Refactor: Remove unused logging and path management utilities
- Removed the rollingLog import and its usage in doctor.ts. - Deleted the animatedRainbow function from install.ts. - Removed the log following implementation in logs.ts. - Deleted the PathResolver class and its related methods in paths.ts. - Removed the SettingsManager class and its associated methods in settings.ts. - Deleted the JSONLStorageProvider class and its methods in storage.ts. - Removed the CompressionError class from types.ts. - Cleaned up the Platform utility by removing unnecessary methods related to shell and file permissions.
This commit is contained in:
+1
-36
@@ -1,6 +1,5 @@
|
||||
import { platform, homedir } from 'os';
|
||||
import { execSync } from 'child_process';
|
||||
import { chmodSync } from 'fs';
|
||||
import { join } from 'path';
|
||||
|
||||
const isWindows = platform() === 'win32';
|
||||
@@ -10,20 +9,6 @@ const isWindows = platform() === 'win32';
|
||||
* Handles differences between Windows and Unix-like systems
|
||||
*/
|
||||
export const Platform = {
|
||||
/**
|
||||
* Returns the appropriate shell for the current platform
|
||||
*/
|
||||
getShell: (): string => {
|
||||
return isWindows ? 'powershell' : '/bin/sh';
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns the file extension for hook scripts
|
||||
*/
|
||||
getHookExtension: (): string => {
|
||||
return '.js'; // Both platforms can execute Node.js scripts
|
||||
},
|
||||
|
||||
/**
|
||||
* Finds the path to an executable command
|
||||
* @param name - Name of the executable to find
|
||||
@@ -37,16 +22,6 @@ export const Platform = {
|
||||
}).trim();
|
||||
},
|
||||
|
||||
/**
|
||||
* Makes a file executable (Unix only - no-op on Windows)
|
||||
* @param path - Path to the file to make executable
|
||||
*/
|
||||
makeExecutable: (path: string): void => {
|
||||
if (!isWindows) {
|
||||
chmodSync(path, 0o755);
|
||||
}
|
||||
},
|
||||
|
||||
/**
|
||||
* Installs uv package manager using platform-specific method
|
||||
*/
|
||||
@@ -98,15 +73,5 @@ export const Platform = {
|
||||
|
||||
// Bash/Zsh alias syntax
|
||||
return `alias ${aliasName}='${command}'`;
|
||||
},
|
||||
|
||||
/**
|
||||
* Returns whether the current platform is Windows
|
||||
*/
|
||||
isWindows: (): boolean => isWindows,
|
||||
|
||||
/**
|
||||
* Returns whether the current platform is Unix-like (macOS/Linux)
|
||||
*/
|
||||
isUnix: (): boolean => !isWindows
|
||||
}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user