mirror of
https://github.com/AutoMaker-Org/automaker.git
synced 2026-02-03 08:53:36 +00:00
Compare commits
8 Commits
b8fa7fc579
...
ebc7987988
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
ebc7987988 | ||
|
|
29b3eef500 | ||
|
|
010e516b0e | ||
|
|
00e4712ae7 | ||
|
|
4b4ae04fbe | ||
|
|
04775af561 | ||
|
|
07f777da22 | ||
|
|
b10501ea79 |
@@ -43,10 +43,14 @@ export function createInitGitHandler() {
|
||||
// .git doesn't exist, continue with initialization
|
||||
}
|
||||
|
||||
// Initialize git and create an initial empty commit
|
||||
await execAsync(`git init && git commit --allow-empty -m "Initial commit"`, {
|
||||
cwd: projectPath,
|
||||
});
|
||||
// Initialize git with 'main' as the default branch (matching GitHub's standard since 2020)
|
||||
// and create an initial empty commit
|
||||
await execAsync(
|
||||
`git init --initial-branch=main && git commit --allow-empty -m "Initial commit"`,
|
||||
{
|
||||
cwd: projectPath,
|
||||
}
|
||||
);
|
||||
|
||||
res.json({
|
||||
success: true,
|
||||
|
||||
@@ -20,8 +20,8 @@ export interface TestRepo {
|
||||
export async function createTestGitRepo(): Promise<TestRepo> {
|
||||
const tmpDir = await fs.mkdtemp(path.join(os.tmpdir(), 'automaker-test-'));
|
||||
|
||||
// Initialize git repo
|
||||
await execAsync('git init', { cwd: tmpDir });
|
||||
// Initialize git repo with 'main' as the default branch (matching GitHub's standard)
|
||||
await execAsync('git init --initial-branch=main', { cwd: tmpDir });
|
||||
|
||||
// Use environment variables instead of git config to avoid affecting user's git config
|
||||
// These env vars override git config without modifying it
|
||||
@@ -38,9 +38,6 @@ export async function createTestGitRepo(): Promise<TestRepo> {
|
||||
await execAsync('git add .', { cwd: tmpDir, env: gitEnv });
|
||||
await execAsync('git commit -m "Initial commit"', { cwd: tmpDir, env: gitEnv });
|
||||
|
||||
// Create main branch explicitly
|
||||
await execAsync('git branch -M main', { cwd: tmpDir });
|
||||
|
||||
return {
|
||||
path: tmpDir,
|
||||
cleanup: async () => {
|
||||
|
||||
@@ -14,7 +14,8 @@ describe('worktree create route - repositories without commits', () => {
|
||||
|
||||
async function initRepoWithoutCommit() {
|
||||
repoPath = await fs.mkdtemp(path.join(os.tmpdir(), 'automaker-no-commit-'));
|
||||
await execAsync('git init', { cwd: repoPath });
|
||||
// Initialize with 'main' as the default branch (matching GitHub's standard)
|
||||
await execAsync('git init --initial-branch=main', { cwd: repoPath });
|
||||
// Don't set git config - use environment variables in commit operations instead
|
||||
// to avoid affecting user's git config
|
||||
// Intentionally skip creating an initial commit
|
||||
|
||||
@@ -7,8 +7,8 @@
|
||||
*/
|
||||
|
||||
import { execSync } from 'child_process';
|
||||
import { cpSync, existsSync, mkdirSync, rmSync, writeFileSync, readFileSync } from 'fs';
|
||||
import { join, dirname } from 'path';
|
||||
import { cpSync, existsSync, mkdirSync, rmSync, writeFileSync, readFileSync, lstatSync } from 'fs';
|
||||
import { join, dirname, resolve } from 'path';
|
||||
import { fileURLToPath } from 'url';
|
||||
|
||||
const __filename = fileURLToPath(import.meta.url);
|
||||
@@ -112,6 +112,29 @@ execSync('npm install --omit=dev', {
|
||||
},
|
||||
});
|
||||
|
||||
// Step 6b: Replace symlinks for local packages with real copies
|
||||
// npm install creates symlinks for file: references, but these break when packaged by electron-builder
|
||||
console.log('🔗 Replacing symlinks with real directory copies...');
|
||||
const nodeModulesAutomaker = join(BUNDLE_DIR, 'node_modules', '@automaker');
|
||||
for (const pkgName of LOCAL_PACKAGES) {
|
||||
const pkgDir = pkgName.replace('@automaker/', '');
|
||||
const nmPkgPath = join(nodeModulesAutomaker, pkgDir);
|
||||
try {
|
||||
// lstatSync does not follow symlinks, allowing us to check for broken ones
|
||||
if (lstatSync(nmPkgPath).isSymbolicLink()) {
|
||||
const realPath = resolve(BUNDLE_DIR, 'libs', pkgDir);
|
||||
rmSync(nmPkgPath);
|
||||
cpSync(realPath, nmPkgPath, { recursive: true });
|
||||
console.log(` ✓ Replaced symlink: ${pkgName}`);
|
||||
}
|
||||
} catch (error) {
|
||||
// If the path doesn't exist, lstatSync throws ENOENT. We can safely ignore this.
|
||||
if (error.code !== 'ENOENT') {
|
||||
throw error;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Step 7: Rebuild native modules for current architecture
|
||||
// This is critical for modules like node-pty that have native bindings
|
||||
console.log('🔨 Rebuilding native modules for current architecture...');
|
||||
|
||||
@@ -1275,8 +1275,10 @@ export function BoardView() {
|
||||
maxConcurrency={maxConcurrency}
|
||||
runningAgentsCount={runningAutoTasks.length}
|
||||
onConcurrencyChange={(newMaxConcurrency) => {
|
||||
if (currentProject && selectedWorktree) {
|
||||
const branchName = selectedWorktree.isMain ? null : selectedWorktree.branch;
|
||||
if (currentProject) {
|
||||
// If selectedWorktree is undefined or it's the main worktree, branchName will be null.
|
||||
// Otherwise, use the branch name.
|
||||
const branchName = selectedWorktree?.isMain === false ? selectedWorktree.branch : null;
|
||||
setMaxConcurrencyForWorktree(currentProject.id, branchName, newMaxConcurrency);
|
||||
|
||||
// Persist to server settings so capacity checks use the correct value
|
||||
|
||||
@@ -750,6 +750,9 @@ export function electronUserDataWriteFileSync(
|
||||
throw new Error('[SystemPaths] Electron userData path not initialized');
|
||||
}
|
||||
const fullPath = path.join(electronUserDataPath, relativePath);
|
||||
// Ensure parent directory exists (may not exist on first launch)
|
||||
const dir = path.dirname(fullPath);
|
||||
fsSync.mkdirSync(dir, { recursive: true });
|
||||
fsSync.writeFileSync(fullPath, data, options);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user