summaryrefslogtreecommitdiff
path: root/jenkins-helpers.sh
diff options
context:
space:
mode:
Diffstat (limited to 'jenkins-helpers.sh')
-rw-r--r--jenkins-helpers.sh11
1 files changed, 11 insertions, 0 deletions
diff --git a/jenkins-helpers.sh b/jenkins-helpers.sh
index 58ec2a29..33218625 100644
--- a/jenkins-helpers.sh
+++ b/jenkins-helpers.sh
@@ -1,5 +1,16 @@
#!/bin/bash
+# Print absolute path to a file or directory
+# $1: Path (must exist)
+abs_path ()
+{
+ (
+ set -euf -o pipefail
+
+ echo "$(cd $(dirname "$1") && pwd)/$(basename "$1")"
+ )
+}
+
# Assert that $@ returns success.
assert ()
{