mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 08:13:37 +00:00
feat: add VITE_APP_MODE environment variable support
- Introduced VITE_APP_MODE variable in multiple files to manage application modes. - Updated dev.mjs and docker-compose.dev.yml to set different modes for development. - Enhanced type definitions in vite-env.d.ts to include VITE_APP_MODE options. - Modified AutomakerLogo component to display version suffix based on the current app mode. - Improved OS detection logic in use-os-detection.ts to utilize Electron's platform information. - Updated ElectronAPI interface to expose platform information. These changes provide better control over application behavior based on the mode, enhancing the development experience.
This commit is contained in:
@@ -10,11 +10,12 @@ export interface OSDetectionResult {
|
||||
}
|
||||
|
||||
function detectOS(): OperatingSystem {
|
||||
// Check Electron's process.platform first (most reliable in Electron apps)
|
||||
if (typeof process !== 'undefined' && process.platform) {
|
||||
if (process.platform === 'darwin') return 'mac';
|
||||
if (process.platform === 'win32') return 'windows';
|
||||
if (process.platform === 'linux') return 'linux';
|
||||
// Check Electron's exposed platform first (via preload contextBridge)
|
||||
if (typeof window !== 'undefined' && window.electronAPI?.platform) {
|
||||
const platform = window.electronAPI.platform;
|
||||
if (platform === 'darwin') return 'mac';
|
||||
if (platform === 'win32') return 'windows';
|
||||
if (platform === 'linux') return 'linux';
|
||||
}
|
||||
|
||||
if (typeof navigator === 'undefined') {
|
||||
|
||||
Reference in New Issue
Block a user