Skip to content
This repository was archived by the owner on Mar 3, 2026. It is now read-only.

Commit f7f59d2

Browse files
authored
Merge pull request #57 from OpenForgeProject/copilot/sub-pr-56
Address code review findings: remove unreachable code and fix style issues
2 parents 10672e9 + 2fed5e9 commit f7f59d2

2 files changed

Lines changed: 4 additions & 8 deletions

File tree

src/shared/utils/ddev-utils.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ export class DdevUtils {
204204
}
205205

206206
if (result.status !== 0) {
207-
// Enhance error message with more details
207+
// Enhance error message with more details
208208
const enhancedError = new Error(result.stderr || 'Command execution failed');
209209
enhancedError.name = 'CommandError';
210210
(enhancedError as any).status = result.status;
@@ -214,10 +214,8 @@ export class DdevUtils {
214214
(enhancedError as any).workspacePath = workspacePath;
215215
throw enhancedError;
216216
}
217-
218-
return result.stdout;
219217
} catch (error: any) {
220-
// If error was already thrown above, rethrow it
218+
// If error was already thrown above, rethrow it
221219
if (error.name === 'CommandError') {
222220
throw error;
223221
}

src/test/ddev-utils.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,19 +20,17 @@
2020
import * as assert from 'assert';
2121
import * as sinon from 'sinon';
2222
import { afterEach, beforeEach } from 'mocha';
23+
import * as cp from 'child_process';
24+
import * as fs from 'fs';
2325
import { DdevUtils } from '../shared/utils/ddev-utils';
2426

25-
2627
suite('DdevUtils Test Suite', () => {
2728
let sandbox: sinon.SinonSandbox;
2829
let spawnSyncStub: sinon.SinonStub;
2930
let existsSyncStub: sinon.SinonStub;
3031

3132
beforeEach(() => {
3233
sandbox = sinon.createSandbox();
33-
// Use require to get the module to ensure we can stub it
34-
const cp = require('child_process');
35-
const fs = require('fs');
3634

3735
// Try to stub, but handle if it fails (basic check)
3836
try {

0 commit comments

Comments
 (0)