first commit

This commit is contained in:
lucaspalomodevelop 2023-03-07 20:20:01 +01:00
parent 7d551a77c2
commit f5e5eb9098
7 changed files with 739 additions and 707 deletions

64
.gitignore vendored
View File

@ -1,32 +1,32 @@
# Prerequisites # Prerequisites
*.d *.d
# Compiled Object files # Compiled Object files
*.slo *.slo
*.lo *.lo
*.o *.o
*.obj *.obj
# Precompiled Headers # Precompiled Headers
*.gch *.gch
*.pch *.pch
# Compiled Dynamic libraries # Compiled Dynamic libraries
*.so *.so
*.dylib *.dylib
*.dll *.dll
# Fortran module files # Fortran module files
*.mod *.mod
*.smod *.smod
# Compiled Static libraries # Compiled Static libraries
*.lai *.lai
*.la *.la
*.a *.a
*.lib *.lib
# Executables # Executables
*.exe *.exe
*.out *.out
*.app *.app

1348
LICENSE

File diff suppressed because it is too large Load Diff

View File

@ -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
View File

@ -0,0 +1,3 @@
all:
g++ -std=c++11 ./src/main.cpp -o ./src/autom
./src/autom test

BIN
src/autom Normal file

Binary file not shown.

BIN
src/main Normal file

Binary file not shown.

25
src/main.cpp Normal file
View 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;
}