From 043983dd8b1ca13ab00fa35d61f5e7d4452d0e2a Mon Sep 17 00:00:00 2001 From: Marcel Schneider Date: Mon, 14 Dec 2020 10:12:57 +0100 Subject: [PATCH] Add readme and requirements --- README.md | 58 ++++++++++++++++++++++++++++++++++++++++++++++++ requirements.txt | 2 ++ 2 files changed, 60 insertions(+) create mode 100644 README.md create mode 100644 requirements.txt diff --git a/README.md b/README.md new file mode 100644 index 0000000..dae334a --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +# dirbuild + +Easily manage build commands + +## Description + +Building software involves the execution of some configuration steps, the +building helper it self and maybe some other things. Each project has it's very +own structure, so remembering the exact commands for all projects is hard. +This small script aims to help with this. +You can set a specific command needed to build the software in your current +directory, and afterward call only `dirbuild`, which will handle the build for +you. + +## Installation + +Clone this repo or just download the script +[dirbuild.py](https://git.schneider-hosting.de/schneider/dirbuild/raw/branch/master/dirbuild.py). +Save it for example at your users bin folder at `~/bin` + +This sript uses pyxdg and docopt. Install manually or after cloning this repo by +`pip install -r requirements.txt`. + +## Usage + +``` +dirbuild + +Usage: + dirbuild + dirbuild set + dirbuild get + dirbuild build + dirbuild dump + +Options: + -h --help Show this screen. + --version Show version. +``` + +An example workflow would look like this. Assume we have cloned the neovim repo +to `~/git/build/neovim` and we already are in this folder. +At the first time we have to set the command we need to build the software: + +``` +dirbuild set "CFLAGS=\"-march=native -pipe\" CXXFLAGS=\"$CFLAGS\" make -j8 && sudo make install" +``` + +We could check the saved command by entering `dirbuild get`, which will print +the same command. + +If we want to build this software, we only have to execute `dirbuild`. + +In the future we can update the code, for example by pulling the repo `git pull` +and executing again `dirbuild`. +Upating the building command can be done by issuing again `dirbuild set` with +the updated command. Old commands are stored in the database an can be retrieved +via `dirbuild dump`. diff --git a/requirements.txt b/requirements.txt new file mode 100644 index 0000000..3de075c --- /dev/null +++ b/requirements.txt @@ -0,0 +1,2 @@ +docopt==0.6.2 +pyxdg==0.26