dank-ai 1.0.14 → 1.0.16
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/docker/manager.js +21 -6
- package/package.json +1 -1
package/lib/docker/manager.js
CHANGED
|
@@ -177,7 +177,9 @@ class DockerManager {
|
|
|
177
177
|
// First, try to update Homebrew to ensure it's working
|
|
178
178
|
this.logger.info('Updating Homebrew...');
|
|
179
179
|
try {
|
|
180
|
-
|
|
180
|
+
const updateCommand = `${homebrewPath} update`;
|
|
181
|
+
this.logger.info(`🔧 About to run command: ${updateCommand}`);
|
|
182
|
+
await this.runCommandWithEnv(updateCommand, 'Updating Homebrew');
|
|
181
183
|
} catch (updateError) {
|
|
182
184
|
this.logger.warn('Homebrew update failed, continuing with installation...');
|
|
183
185
|
}
|
|
@@ -188,7 +190,9 @@ class DockerManager {
|
|
|
188
190
|
// Approach 1: Direct installation
|
|
189
191
|
try {
|
|
190
192
|
this.logger.info('Attempting direct installation...');
|
|
191
|
-
|
|
193
|
+
const command1 = `${homebrewPath} cask install docker`;
|
|
194
|
+
this.logger.info(`🔧 About to run command: ${command1}`);
|
|
195
|
+
await this.runCommandWithEnv(command1, 'Installing Docker Desktop via Homebrew');
|
|
192
196
|
installSuccess = true;
|
|
193
197
|
} catch (error1) {
|
|
194
198
|
this.logger.warn('Direct installation failed, trying alternative approach...');
|
|
@@ -196,7 +200,9 @@ class DockerManager {
|
|
|
196
200
|
// Approach 2: Try with --force flag
|
|
197
201
|
try {
|
|
198
202
|
this.logger.info('Attempting installation with --force flag...');
|
|
199
|
-
|
|
203
|
+
const command2 = `${homebrewPath} cask install --force docker`;
|
|
204
|
+
this.logger.info(`🔧 About to run command: ${command2}`);
|
|
205
|
+
await this.runCommandWithEnv(command2, 'Installing Docker Desktop via Homebrew (force)');
|
|
200
206
|
installSuccess = true;
|
|
201
207
|
} catch (error2) {
|
|
202
208
|
this.logger.warn('Force installation failed, trying with --no-quarantine flag...');
|
|
@@ -204,7 +210,9 @@ class DockerManager {
|
|
|
204
210
|
// Approach 3: Try with --no-quarantine flag
|
|
205
211
|
try {
|
|
206
212
|
this.logger.info('Attempting installation with --no-quarantine flag...');
|
|
207
|
-
|
|
213
|
+
const command3 = `${homebrewPath} cask install --no-quarantine docker`;
|
|
214
|
+
this.logger.info(`🔧 About to run command: ${command3}`);
|
|
215
|
+
await this.runCommandWithEnv(command3, 'Installing Docker Desktop via Homebrew (no-quarantine)');
|
|
208
216
|
installSuccess = true;
|
|
209
217
|
} catch (error3) {
|
|
210
218
|
this.logger.error('All installation approaches failed');
|
|
@@ -217,7 +225,9 @@ class DockerManager {
|
|
|
217
225
|
// Try to start Docker Desktop
|
|
218
226
|
this.logger.info('Starting Docker Desktop...');
|
|
219
227
|
try {
|
|
220
|
-
|
|
228
|
+
const startCommand = 'open -a Docker';
|
|
229
|
+
this.logger.info(`🔧 About to run command: ${startCommand}`);
|
|
230
|
+
await this.runCommandWithEnv(startCommand, 'Starting Docker Desktop');
|
|
221
231
|
} catch (startError) {
|
|
222
232
|
this.logger.warn('Could not start Docker Desktop automatically. Please start it manually from Applications.');
|
|
223
233
|
}
|
|
@@ -228,7 +238,7 @@ class DockerManager {
|
|
|
228
238
|
this.logger.error(`Installation error: ${error.message}`);
|
|
229
239
|
this.logger.info('You can also try installing Docker Desktop manually:');
|
|
230
240
|
this.logger.info('1. Download from: https://www.docker.com/products/docker-desktop/');
|
|
231
|
-
this.logger.info('2. Or try: brew install
|
|
241
|
+
this.logger.info('2. Or try: brew cask install docker');
|
|
232
242
|
throw new Error('Docker Desktop installation via Homebrew failed. Please install manually from https://www.docker.com/products/docker-desktop/');
|
|
233
243
|
}
|
|
234
244
|
} else {
|
|
@@ -413,6 +423,11 @@ class DockerManager {
|
|
|
413
423
|
HOMEBREW_NO_INSTALL_CLEANUP: '1' // Keep installation files
|
|
414
424
|
};
|
|
415
425
|
|
|
426
|
+
// Debug: Log environment details
|
|
427
|
+
this.logger.debug(`Environment PATH: ${env.PATH}`);
|
|
428
|
+
this.logger.debug(`HOMEBREW_NO_AUTO_UPDATE: ${env.HOMEBREW_NO_AUTO_UPDATE}`);
|
|
429
|
+
this.logger.debug(`HOMEBREW_NO_INSTALL_CLEANUP: ${env.HOMEBREW_NO_INSTALL_CLEANUP}`);
|
|
430
|
+
|
|
416
431
|
// Use bash instead of sh for better environment support
|
|
417
432
|
const child = spawn('bash', ['-c', command], {
|
|
418
433
|
stdio: ['inherit', 'pipe', 'pipe'],
|