From 0adfb16fa9c5b811e90018f42b4e1b87c7372735 Mon Sep 17 00:00:00 2001 From: phimage Date: Sun, 10 Nov 2019 19:24:41 +0100 Subject: [PATCH] Add utility script to generate swift file on template change --- Utils/change.sh | 4 ++++ Utils/watch.sh | 6 ++++++ 2 files changed, 10 insertions(+) create mode 100755 Utils/change.sh create mode 100755 Utils/watch.sh diff --git a/Utils/change.sh b/Utils/change.sh new file mode 100755 index 00000000..26e03cb2 --- /dev/null +++ b/Utils/change.sh @@ -0,0 +1,4 @@ +#!/usr/bin/env bash + +BASEDIR=$(dirname "$0") +$BASEDIR/gyb --line-directive '' -o $BASEDIR/../Source/Device.generated.swift $BASEDIR/../Source/Device.swift.gyb diff --git a/Utils/watch.sh b/Utils/watch.sh new file mode 100755 index 00000000..e8a7224c --- /dev/null +++ b/Utils/watch.sh @@ -0,0 +1,6 @@ +#!/usr/bin/env bash + +BASEDIR=$(dirname "$0") + +# brew install fswatch +fswatch $BASEDIR/../Source/Device.swift.gyb | xargs -n1 -I{} $BASEDIR/change.sh