From 9565fdcee6dfc585d0902ea812723a59e144e6aa Mon Sep 17 00:00:00 2001 From: Martinez Date: Mon, 8 Jun 2015 21:05:53 +0200 Subject: [PATCH] add over boilerplate deployment script --- .over_inhibit_deployment | 0 deploy-template.sh | 14 ++++++++++++++ template.py | 31 +++++++++++++++++++++++++++++++ 3 files changed, 45 insertions(+) create mode 100644 .over_inhibit_deployment create mode 100755 deploy-template.sh create mode 100644 template.py diff --git a/.over_inhibit_deployment b/.over_inhibit_deployment new file mode 100644 index 0000000..e69de29 diff --git a/deploy-template.sh b/deploy-template.sh new file mode 100755 index 0000000..671c18c --- /dev/null +++ b/deploy-template.sh @@ -0,0 +1,14 @@ +#! /bin/zsh +# encoding: utf-8 + +if [[ -a ".over_inhibit_deployment" ]]; then + echo '!! deployment inhibited by lock file (hint: run this from the target directory, not the over directory)' +elif [[ -n "$1" ]]; then + OVER_DIR="$(readlink -f "$(dirname "$0")")" + ln -s "$OVER_DIR" + cp "$OVER_DIR/template.py" "$1" + chmod +x "$1" + echo "over" >> .gitignore +else + echo '!! Missing argument (program name).' +fi diff --git a/template.py b/template.py new file mode 100644 index 0000000..ff299dc --- /dev/null +++ b/template.py @@ -0,0 +1,31 @@ +#! /usr/bin/env python3 +# encoding: utf-8 + +# library imports +import over + +# local imports +#import version + +# -------------------------------------------------- +# Exceptions + +class ConfigurationError(Exception): + pass + +# -------------------------------------------------- +# Functions + +# -------------------------------------------------- +# Classes + +# -------------------------------------------------- + +if __name__ == '__main__': + main = over.core.app.Main('PROGRAM_NAME', version.str, 'AO-JSL') + main.add_option('option', 'type', 'default', 'Description.', short_name='s') + main.add_help('Description', ['What it does.']) + main.enable_help('h') + main.parse() + + ...