mirror of
https://github.com/lucaspalomodevelop/autom.git
synced 2026-03-12 23:27:21 +00:00
first commit
This commit is contained in:
parent
7d551a77c2
commit
f5e5eb9098
@ -1 +1,5 @@
|
|||||||
# autom
|
# autom
|
||||||
|
|
||||||
|
__IN DEVELOPMENT, NOT READY FOR USE__
|
||||||
|
|
||||||
|
autom is a command line tool for executing shell scripts, independent of the working directory
|
||||||
3
makefile
Normal file
3
makefile
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
all:
|
||||||
|
g++ -std=c++11 ./src/main.cpp -o ./src/autom
|
||||||
|
./src/autom test
|
||||||
25
src/main.cpp
Normal file
25
src/main.cpp
Normal file
@ -0,0 +1,25 @@
|
|||||||
|
#include <iostream>
|
||||||
|
#include <string>
|
||||||
|
#include <sys/stat.h>
|
||||||
|
|
||||||
|
int main(int argc, char *argv[])
|
||||||
|
{
|
||||||
|
|
||||||
|
// make dir in /etc/autom
|
||||||
|
std::string home = getenv("HOME");
|
||||||
|
std::string dir = home + "/.autom";
|
||||||
|
// std::cout << "dir: " << dir << std::endl;
|
||||||
|
mkdir(dir.c_str(), 0777);
|
||||||
|
|
||||||
|
if (argc > 1 && argv[1][0] != '-')
|
||||||
|
{
|
||||||
|
std::string pre_script = "cd " + dir + " && ";
|
||||||
|
std::string script = pre_script + dir + "/" + argv[1] + ".sh";
|
||||||
|
system(script.c_str());
|
||||||
|
}
|
||||||
|
// else{
|
||||||
|
// std::cout << "Usage: autom <script>" << std::endl;
|
||||||
|
// }
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
Loading…
x
Reference in New Issue
Block a user