diff options
-rwxr-xr-x | license-generator/bin/init | 3 | ||||
-rwxr-xr-x | license-generator/bin/setup | 39 |
2 files changed, 42 insertions, 0 deletions
diff --git a/license-generator/bin/init b/license-generator/bin/init new file mode 100755 index 0000000..fc94ebd --- /dev/null +++ b/license-generator/bin/init @@ -0,0 +1,3 @@ +#!/bin/sh + +source .env diff --git a/license-generator/bin/setup b/license-generator/bin/setup new file mode 100755 index 0000000..04b411f --- /dev/null +++ b/license-generator/bin/setup @@ -0,0 +1,39 @@ +#!/bin/sh + +function program_exists () { + local program="$1" + + command -v "$program" > /dev/null +} + +function install_if_not_found () { + local program="$1" + + if ! program_exists "$1"; then + brew install "$program" + fi +} + +if [ "$1" = "--install" ]; then + if ! program_exists hasp; then + mkdir /usr/local/Cellar/hasp + git clone https://github.com/djanowski/hasp.git /usr/local/Cellar/hasp/HEAD + brew link hasp + fi + + install_if_not_found golang-migrate + + if ! program_exists mysql; then + brew install mariadb + fi +fi + + +if [ ! -f .env ]; then + cp .env.sample .env +fi + + +vim .env +source .env +migrate-up |