├── .gitignore ├── README.md ├── cRun └── example.gif /.gitignore: -------------------------------------------------------------------------------- 1 | test/ 2 | a.out 3 | *.swp 4 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # cppRunner 2 | Watch to compile and run c++ files. 3 | 4 | ![cppRunner](https://raw.githubusercontent.com/CoolVoltage/cppRunner/master/example.gif "cppRunner!") 5 | 6 | 7 | #Installing 8 | 9 | Download the zip or clone the repo. 10 | 11 | ```sh 12 | $ cp cRun /usr/bin/. 13 | ``` 14 | #Options 15 | 16 | ```sh 17 | $ cRun srcFileName.cpp -i testInput.txt 18 | ``` 19 | Or 20 | ```sh 21 | $ cRun srcFileName.c -i testInput.txt 22 | ``` 23 | Or 24 | ```sh 25 | $ cRun srcFileName.cpp 26 | ``` 27 | Contribute 28 | ---------- 29 | If you want to add features, improve them, or report issues, feel free to send a pull request! 30 | -------------------------------------------------------------------------------- /cRun: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | #to kill child process on ctrl+c 4 | trap "kill 0" SIGINT 5 | 6 | srcHash=0 7 | inpHash=1 8 | 9 | tempInpHash=1 10 | tempSrcHash=1 11 | 12 | inputFile="" 13 | file="" 14 | extension="" 15 | 16 | #holds pid of childprocess which runs the executable file 17 | outputChild="" 18 | 19 | # 20 | runExecutable () { 21 | rerun="" 22 | cat $inputFile | "./$fileName" 23 | echo 24 | echo "(Type rs to rerun)" 25 | read rerun