Skip to content

Commit

Permalink
update: add $ syntax for executing single use cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
marcuwynu23 committed Mar 6, 2023
1 parent b67eca6 commit 763fe32
Show file tree
Hide file tree
Showing 3 changed files with 28 additions and 5 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
**.exe**
/bin
bin
Binary file modified bin/auto.exe
Binary file not shown.
31 changes: 27 additions & 4 deletions src/lib.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -97,7 +97,7 @@ void __readStringLine(std::string fileName)
// remove the first character
tp = tp.erase(0, 1);
// execute the command with start -
string command = "start /WAIT \"" + tp + "\" cmd /K " + tp;
string command = "start \"" + tp + "\" cmd /K " + tp;
__termExecuteAsync(command);
}
else if (executionType == 0)
Expand All @@ -107,7 +107,7 @@ void __readStringLine(std::string fileName)
// remove the first character
tp = tp.erase(0, 1);
// execute the command with start -
string command = "start /WAIT \"" + tp + "\" cmd /K " + tp;
string command = "start \"" + tp + "\" cmd /K " + tp;
__termExecuteSync(command);
}
}
Expand All @@ -121,7 +121,7 @@ void __readStringLine(std::string fileName)
// remove the first character
tp = tp.erase(0, 1);
// execute the command with start -
string command = "start /WAIT /MIN \"" + tp + "\" cmd /K " + tp;
string command = "start /MIN \"" + tp + "\" cmd /K " + tp;
__termExecuteAsync(command);
}
else if (executionType == 0)
Expand All @@ -131,7 +131,30 @@ void __readStringLine(std::string fileName)
// remove the first character
tp = tp.erase(0, 1);
// execute the command with start -
string command = "start /WAIT /MIN \"" + tp + "\" cmd /K " + tp;
string command = "start /MIN \"" + tp + "\" cmd /K " + tp;
__termExecuteSync(command);
}
}
if (tp[0] == '$')
{
if (executionType == 1)
{
// print the commands
__termPrintAsync(executionType, tp);
// remove the first character
tp = tp.erase(0, 1);
// execute the command with start -
string command = "start /MIN \"" + tp + "\" cmd /C " + tp;
__termExecuteAsync(command);
}
else if (executionType == 0)
{
// print the commands
__termPrintSync(executionType, tp);
// remove the first character
tp = tp.erase(0, 1);
// execute the command with start -
string command = "start /MIN \"" + tp + "\" cmd /C " + tp;
__termExecuteSync(command);
}
}
Expand Down

0 comments on commit 763fe32

Please sign in to comment.