From 1431fad33b74b167f157b8eb7434710ce1027253 Mon Sep 17 00:00:00 2001 From: belliash Date: Sun, 15 Jan 2012 17:30:07 +0100 Subject: [PATCH] implement functionExists() --- libraries/common | 9 +++++++++ modules/sample.ezmod | 5 +++++ 2 files changed, 14 insertions(+) diff --git a/libraries/common b/libraries/common index fd74553..5cb1234 100644 --- a/libraries/common +++ b/libraries/common @@ -72,6 +72,15 @@ function fail() { fi } +#------------------------------------------------------------------------------- +# Checks if the given function has been defined +# Parameters: %function% +#------------------------------------------------------------------------------- +function functionExists() { + type ${1} 2>/dev/null | grep -q "is a function" + return ${?} +} + #------------------------------------------------------------------------------- # Checks whether a defined variable contain specified element or not # Parameters: %element% %variable% diff --git a/modules/sample.ezmod b/modules/sample.ezmod index c5c2472..a944f2e 100644 --- a/modules/sample.ezmod +++ b/modules/sample.ezmod @@ -2,3 +2,8 @@ EZMOD_DESCRIPTION="Sample module for learning and testing purposes" EZMOD_COMPATIBILITY="ezbuild ezsync" EZMOD_AUTHOR="Rafal Kupiec" EZMOD_VERSION="0.1" + +ezsync_postsync() { + printWarn "fdgdfs" +# return 1 +}