From 034581a9bd6e932421727570ef2ada0b262f05dd Mon Sep 17 00:00:00 2001 From: Joseph Werle Date: Thu, 29 May 2014 12:45:24 -0400 Subject: [PATCH] prevent sourcing bpkg and bump minor --- bpkg.sh | 18 ++++++++++-------- package.json | 2 +- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/bpkg.sh b/bpkg.sh index ecc166b..f9d5136 100755 --- a/bpkg.sh +++ b/bpkg.sh @@ -1,6 +1,13 @@ #!/bin/bash -VERSION="0.1.0" +## prevent sourcing +if [[ ${BASH_SOURCE[0]} != $0 ]]; then + echo >&2 "error: \`bpkg' cannot be sourced" + return 1 +fi + +## bpkg version +VERSION="0.2.0" ## output error to stderr error () { @@ -106,10 +113,5 @@ bpkg () { return 1 } -## export or run -if [[ ${BASH_SOURCE[0]} != $0 ]]; then - export -f bpkg -else - bpkg "${@}" - exit $? -fi +bpkg "${@}" +exit $? diff --git a/package.json b/package.json index bc495f3..609b932 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "bpkg", - "version": "0.1.0", + "version": "0.2.0", "description": "Lightweight bash package manager", "global": true, "install": "make install"