Skip to content

Commit

Permalink
fixed path issue
Browse files Browse the repository at this point in the history
  • Loading branch information
mnoomnoo committed May 1, 2023
1 parent 63b3840 commit b770282
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,8 @@
// "args": ["123123DropBox.exe", "-sleepTime", "1200"],
// "args": ["123123DropBox.exe", "-sleepTime", "a1200"],
// "args": ["123123DropBox.exe", "-sleepTime"],
"args": ["-exesConfig"],
// "args": ["-exesConfig"],
"args": ["-ec"],
"stopAtEntry": false,
"cwd": "${workspaceFolder}",
"environment": [],
Expand Down
8 changes: 5 additions & 3 deletions src/ProgramArgs.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

#include <vector>
#include <algorithm>
#include <filesystem>
#include <fstream>

#include "Common.h"
Expand Down Expand Up @@ -68,8 +69,9 @@ bool ProcessProgramArgs(int argc , const char** argv, ProgramCmdLineOptions& pro
cmdArgs.pop_back();

if(hasExeConfigs)
{
std::ifstream file("exesConfig.ecfg");
{
const std::string exeConfPath = std::filesystem::current_path().string() + "\\" + "exesConfig.ecfg";
std::ifstream file(exeConfPath);
if (file.is_open())
{
std::string line;
Expand All @@ -84,7 +86,7 @@ bool ProcessProgramArgs(int argc , const char** argv, ProgramCmdLineOptions& pro
}
else
{
PrintToConsole( "exesConfigs.ecfg not found\n" );
PrintToConsole( "exesConfig.ecfg not found\n" );
return false;
}
}
Expand Down

0 comments on commit b770282

Please sign in to comment.