import { window , commands } from "vscode" ; import { sync as commandExists } from "command-exists" ; import { existsSync } from "fs-extra" ; import { ConfigurationManager } from "./configuration-manager" ; let settings = ConfigurationManager . getInstance ( ) ; export const existPrerequisites = ( ) : boolean => { let bCheck = true ; if ( ! commandExists ( "git" ) ) { window . showErrorMessage ( `Oradew: "git" command (Git) is required in command-line.` ) ; bCheck = false ; } if ( ! commandExists ( "node" ) ) { window . showErrorMessage ( `Oradew: "node" command (Node.js) is required in command-line.` ) ; bCheck = false ; } if ( ! commandExists ( "sqlplus" ) && ! commandExists ( "sql" ) ) { window . showWarningMessage ( `Oradew: "sqlplus" (SQL*Plus) or "sql" (SQLcl) command is required in command-line for certain commands.` ) ; } return bCheck ; } ; export const setInitialized = ( ) => { if ( existsSync ( settings . databaseConfigFile ) && existPrerequisites ( ) ) { commands . executeCommand ( "setContext" , "inOradewProject" , true ) ; } else { commands . executeCommand ( "setContext" , "inOradewProject" , false ) ; } } ;