mirror of
https://github.com/sam-astro/Z-Sharp.git
synced 2025-12-10 15:52:12 +00:00
Add the "ZS.System.Command" function
Add the "ZS.System.Command" function in order to run console commands. Something like pythons os.system() function.
This commit is contained in:
parent
926a8e60f7
commit
adcbe1f232
@ -13,6 +13,7 @@
|
||||
#include <ctime>
|
||||
#include <math.h>
|
||||
#include <sys/stat.h>
|
||||
#include <cstdlib> // for console command printing
|
||||
|
||||
#include "strops.h"
|
||||
#include "graphics.h"
|
||||
@ -467,6 +468,8 @@ boost::any ZSFunction(const string& name, const vector<boost::any>& args)
|
||||
Vec2 v(AnyAsFloat(args.at(0)), AnyAsFloat(args.at(1)));
|
||||
return v;
|
||||
}
|
||||
else if (name == "ZS.System.Command")
|
||||
temp = system(StringRaw(AnyAsString(args.at(0))));
|
||||
else
|
||||
LogWarning("ZS function \'" + name + "\' does not exist.");
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user