mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-01 20:23:36 +00:00
chore: update Docker configuration and entrypoint script
- Enhanced .dockerignore to exclude additional build outputs and dependencies. - Modified dev.mjs and start.mjs to change Docker container startup behavior, removing the --build flag to preserve volumes. - Updated docker-compose.yml to add a new volume for persisting Claude CLI OAuth session keys. - Introduced docker-entrypoint.sh to fix permissions on the Claude CLI config directory. - Adjusted Dockerfile to include the entrypoint script and ensure proper user permissions. These changes improve the Docker setup and streamline the development workflow.
This commit is contained in:
@@ -7,12 +7,28 @@ import { createLogger } from '@automaker/utils/logger';
|
||||
import { getHttpApiClient } from './http-api-client';
|
||||
import { getElectronAPI } from './electron';
|
||||
import { getItem, setItem } from './storage';
|
||||
import path from 'path';
|
||||
|
||||
const logger = createLogger('WorkspaceConfig');
|
||||
|
||||
const LAST_PROJECT_DIR_KEY = 'automaker:lastProjectDir';
|
||||
|
||||
/**
|
||||
* Browser-compatible path join utility
|
||||
* Works in both Node.js and browser environments
|
||||
*/
|
||||
function joinPath(...parts: string[]): string {
|
||||
// Remove empty parts and normalize separators
|
||||
const normalized = parts
|
||||
.filter((p) => p)
|
||||
.map((p) => p.replace(/\\/g, '/'))
|
||||
.join('/')
|
||||
.replace(/\/+/g, '/'); // Remove duplicate slashes
|
||||
|
||||
// Preserve leading slash if first part had it
|
||||
const hasLeadingSlash = parts[0]?.startsWith('/');
|
||||
return hasLeadingSlash ? '/' + normalized.replace(/^\//, '') : normalized;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the default Documents/Automaker directory path
|
||||
* @returns Promise resolving to Documents/Automaker path, or null if unavailable
|
||||
@@ -21,7 +37,7 @@ async function getDefaultDocumentsPath(): Promise<string | null> {
|
||||
try {
|
||||
const api = getElectronAPI();
|
||||
const documentsPath = await api.getPath('documents');
|
||||
return path.join(documentsPath, 'Automaker');
|
||||
return joinPath(documentsPath, 'Automaker');
|
||||
} catch (error) {
|
||||
logger.error('Failed to get documents path:', error);
|
||||
return null;
|
||||
|
||||
Reference in New Issue
Block a user