mirror of
https://github.com/SpartanJ/eepp.git
synced 2026-08-04 05:50:24 +03:00
Added some logs.
This commit is contained in:
@@ -728,25 +728,30 @@ void ProjectBuildManager::runConfig( StatusAppOutputController* saoc ) {
|
||||
}
|
||||
}
|
||||
|
||||
if ( nullptr == run )
|
||||
if ( nullptr == run ) {
|
||||
Log::info( "No run configuration found to run with runName: %s", mConfig.runName );
|
||||
return;
|
||||
}
|
||||
|
||||
ProjectBuildCommand finalBuild( build->replaceVars( *run ) );
|
||||
replaceDynamicVars( finalBuild );
|
||||
auto cmd = finalBuild.cmd + " " + finalBuild.args;
|
||||
auto cmd = String::trim( finalBuild.cmd ) + " " + finalBuild.args;
|
||||
if ( finalBuild.runInTerminal ) {
|
||||
UITerminal* term = mApp->getTerminalManager()->createTerminalInSplitter(
|
||||
finalBuild.workingDir, false );
|
||||
Log::info( "Running \"%s\" in terminal", cmd );
|
||||
if ( term == nullptr || term->getTerm() == nullptr ) {
|
||||
mApp->getTerminalManager()->openInExternalTerminal( cmd, finalBuild.workingDir );
|
||||
} else {
|
||||
term->executeFile( cmd );
|
||||
}
|
||||
} else {
|
||||
// Sys::execute( cmd, finalBuild.workingDir );
|
||||
Log::info( "Running \"%s\" in app", cmd );
|
||||
finalBuild.config = build->getConfig();
|
||||
saoc->run( finalBuild, {} );
|
||||
}
|
||||
} else {
|
||||
Log::info( "ProjectBuildManager::runConfig is already running or isRunningApp() is true" );
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -339,17 +339,24 @@ if not %autoclose%==1 pause
|
||||
)shellscript";
|
||||
if ( !cmd.empty() && !scriptsPath.empty() ) {
|
||||
std::string runHelperPath = scriptsPath + "ecode-run-helper.bat";
|
||||
if ( !FileSystem::fileExists( runHelperPath ) )
|
||||
FileSystem::fileWrite( runHelperPath, RUN_HELPER );
|
||||
std::string cmdDir = String::trim( FileSystem::fileRemoveFileName( cmd ) );
|
||||
if ( cmdDir.empty() )
|
||||
cmdDir = workingDir;
|
||||
std::string cmdFile = String::trim( FileSystem::fileNameFromPath( cmd ) );
|
||||
auto fcmd = "cmd.exe /q /c " + quoteString( "\"" + runHelperPath + "\" \"" + cmdDir +
|
||||
"\" 0 \"" + cmdFile + "\"" );
|
||||
Log::info( "Running: %s", fcmd );
|
||||
Sys::execute( fcmd, workingDir );
|
||||
return;
|
||||
bool canContinue = true;
|
||||
if ( !FileSystem::fileExists( runHelperPath ) ) {
|
||||
if ( !FileSystem::fileWrite( runHelperPath, RUN_HELPER ) )
|
||||
canContinue = false;
|
||||
}
|
||||
if ( canContinue ) {
|
||||
std::string cmdDir = String::trim( FileSystem::fileRemoveFileName( cmd ) );
|
||||
if ( cmdDir.empty() )
|
||||
cmdDir = workingDir;
|
||||
std::string cmdFile = String::trim( FileSystem::fileNameFromPath( cmd ) );
|
||||
auto fcmd = "cmd.exe /q /c " + quoteString( "\"" + runHelperPath + "\" \"" + cmdDir +
|
||||
"\" 0 \"" + cmdFile + "\"" );
|
||||
Log::info( "Running: %s", fcmd );
|
||||
Sys::execute( fcmd, workingDir );
|
||||
return;
|
||||
} else {
|
||||
Log::info( "Couldn't write runHelperPath %s", runHelperPath );
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<std::string> options;
|
||||
@@ -406,6 +413,7 @@ static void openExternal( const std::string&, const std::string& cmd, const std:
|
||||
|
||||
void TerminalManager::openInExternalTerminal( const std::string& cmd,
|
||||
const std::string& workingDir ) {
|
||||
Log::info( "Trying to open in external terminal: %s %s", cmd, workingDir );
|
||||
openExternal( mApp->termConfig().shell, cmd, mApp->getScriptsPath(), workingDir );
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user