From 50798d3597368e315a52a15caab9484d8e497eaf Mon Sep 17 00:00:00 2001 From: Deepak Mallubhotla Date: Fri, 8 Apr 2022 16:46:05 -0500 Subject: [PATCH] build: adds nixdo and makes flake even more robust --- flake.nix | 1 + nixdo.sh | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 34 insertions(+) create mode 100755 nixdo.sh diff --git a/flake.nix b/flake.nix index 0a5f75f..d58c60a 100644 --- a/flake.nix +++ b/flake.nix @@ -43,6 +43,7 @@ buildInputs = [ pkgs.poetry pkgs.pdmeEnv + pkgs.pdme ]; }; diff --git a/nixdo.sh b/nixdo.sh new file mode 100755 index 0000000..d83ae9a --- /dev/null +++ b/nixdo.sh @@ -0,0 +1,33 @@ +#!/usr/bin/env bash +# Do - The Simplest Build Tool on Earth. +# Documentation and examples see https://github.com/8gears/do + +set -Eeuo pipefail # -e "Automatic exit from bash shell script on error" -u "Treat unset variables and parameters as errors" + +build() { + echo "I am ${FUNCNAME[0]}ing" + poetry build +} + +test() { + echo "I am ${FUNCNAME[0]}ing" + flake8 pdme tests + mypy pdme + pytest +} + +htmlcov() { + pytest --cov-report=html +} + +release() { + ./scripts/release.sh +} + +all() { + build && test +} + +"$@" # <- execute the task + +[ "$#" -gt 0 ] || printf "Usage:\n\t./nixdo.sh %s\n" "($(compgen -A function | grep '^[^_]' | paste -sd '|' -))"