summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJosé Mota <jose@josemota.net>2016-06-09 23:57:26 +0100
committerJosé Mota <jose@josemota.net>2016-06-09 23:57:26 +0100
commit76527efa2b55d68f5b1357ca7d92cff8c2f08027 (patch)
tree2a4507012f143089f77156518812bd9183cfd023
parent4eebaa63f19c075734ae6a04a7c4e5ec4e0f3290 (diff)
Extract build method.
-rwxr-xr-xbin/thomas14
1 files changed, 8 insertions, 6 deletions
diff --git a/bin/thomas b/bin/thomas
index 3d049eb..b05ead5 100755
--- a/bin/thomas
+++ b/bin/thomas
@@ -1,5 +1,8 @@
#!/bin/bash
+FILE=$1
+OUTPUT_FOLDER=output
+
install_mo() {
local confirm
if ! command -v "bin/mo" 2>&1 > /dev/null; then
@@ -16,13 +19,12 @@ install_mo() {
fi
}
-FILE=$1
-OUTPUT_FOLDER=output
-
-mkdir -p $OUTPUT_FOLDER
+build(){
+ mkdir -p $OUTPUT_FOLDER
+ source thomas.env && cat templates/$1 | bin/mo > $OUTPUT_FOLDER/$FILE
+}
install_mo
-
-source thomas.env && cat templates/$1 | bin/mo > $OUTPUT_FOLDER/$FILE
+build
echo $OUTPUT_FOLDER/$FILE