File tree 1 file changed +17
-2
lines changed
1 file changed +17
-2
lines changed Original file line number Diff line number Diff line change @@ -2,15 +2,30 @@ import * as vscode from 'vscode';
2
2
import * as fs from 'fs' ;
3
3
import * as os from 'os' ;
4
4
import * as path from 'path' ;
5
+ import { execSync } from 'child_process' ;
5
6
6
7
let gooseTerminal : vscode . Terminal | undefined ;
7
8
const terminalName = '🪿 goose agent 🪿' ;
8
9
const tempFilePath = path . join ( os . tmpdir ( ) , 'goose_open_files.txt' ) ;
9
10
const tempFilePathDirty = path . join ( os . tmpdir ( ) , 'goose_unsaved_files.txt' ) ;
10
11
11
-
12
12
export function activate ( context : vscode . ExtensionContext ) {
13
- vscode . window . showInformationMessage ( 'goose agent activated' ) ;
13
+
14
+ // Check if goose CLI is installed
15
+ try {
16
+ execSync ( 'goose' ) ;
17
+ } catch ( error ) {
18
+ const installUrl = 'https://github.com/square/goose-vscode' ;
19
+ vscode . window . showErrorMessage ( 'Goose CLI is required to be installed' , { modal : true } , 'Install' ) . then ( selection => {
20
+ if ( selection === 'Install' ) {
21
+ vscode . env . openExternal ( vscode . Uri . parse ( installUrl ) ) ;
22
+ }
23
+ } ) ;
24
+ return ; // Exit activation if goose is not installed
25
+ }
26
+
27
+ vscode . window . showInformationMessage ( 'goose agent starting - this may take a minute.. 🕐' ) ;
28
+
14
29
15
30
const updateOpenFiles = ( ) => {
16
31
const openTextDocuments = vscode . workspace . textDocuments . filter ( doc => ! ( doc . fileName . startsWith ( 'git' ) || doc . fileName . endsWith ( '.git' ) ) ) ;
You can’t perform that action at this time.
0 commit comments