Execute source files from compiled languages as scripts.
This repository has been archived on 2019-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
tastytea e662b73918
the build was successful Details
Reordered things to make it more pleasant to the brain.
2018-12-29 06:19:53 +01:00
src Reordered things to make it more pleasant to the brain. 2018-12-29 06:19:53 +01:00
xdgcfg@e22f82fc6f Simple files (without flags) work. 2018-12-29 05:15:49 +01:00
.drone.yml Added CI 2018-12-29 05:42:00 +01:00
.gitignore Initial commit. 2018-12-28 13:56:34 +01:00
.gitmodules Initial commit. 2018-12-28 13:56:34 +01:00
CMakeLists.txt Renamed from cppscript to compilescript. 2018-12-29 06:09:50 +01:00
LICENSE Initial commit. 2018-12-28 13:56:34 +01:00
README.md Renamed from cppscript to compilescript. 2018-12-29 06:09:50 +01:00

README.md

compilescript allows you to execute files from compiled languages as scripts. By default it uses g++.

It compiles the source file, stores the binary in ${XDG_CACHE_HOME}/compilescript/ and executes it.

It does compile the file every time at the moment.

Usage

Use #!/usr/bin/env compilescript as shebang and write the compiler arguments in the line below with the prefix: //compilescript:

Example

#!/usr/bin/env compilescript
//compilescript: -Wall -pedantic -Wextra

#include <iostream>

using std::cout;

int main(int argc, char *argv[])
{
    cout << "Hello world!\n";
    cout << argv[1] << '\n';
}

Configuration

The configuration file is in ${XDG_CONFIG_HOME}/compilescript.cfg.

Example config

compiler = "g++";
cache_dir = "/home/user/.cache/compilescript";

Install

From source

Dependencies

Get sourcecode

Download the current release and copy xdgcfg into xdgcfg/.

If you clone from git, be sure to git submodule init and git submodule update afterwards. See the [submodules article in the git book] (https://git-scm.com/book/en/v2/Git-Tools-Submodules#_cloning_submodules) for further info.

Compile

mkdir build
cd build
cmake ..
make
make install

Contributing

Contributions are always welcome. You can submit them as pull requests or via email to tastytea@tastytea.de.

Copyright © 2018 tastytea <tastytea@tastytea.de>.
License GPLv3: GNU GPL version 3 <https://www.gnu.org/licenses/gpl-3.0.html>.
This program comes with ABSOLUTELY NO WARRANTY. This is free software,
and you are welcome to redistribute it under certain conditions.