From 6478d45d28f091c9d12652f94e0e1d45d2f8ee04 Mon Sep 17 00:00:00 2001 From: Leo Germani Date: Fri, 19 Jan 2018 15:06:56 -0200 Subject: [PATCH] setup repository --- .gitignore | 4 ++++ build-config-sample.cfg | 2 ++ build-watch.sh | 11 +++++++++++ build.sh | 15 +++++++++++++++ compile-sass.sh | 16 ++++++++++++++++ src/scss/style.scss | 0 6 files changed, 48 insertions(+) create mode 100644 .gitignore create mode 100755 build-config-sample.cfg create mode 100755 build-watch.sh create mode 100755 build.sh create mode 100644 compile-sass.sh create mode 100644 src/scss/style.scss diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..e91fdf6 --- /dev/null +++ b/.gitignore @@ -0,0 +1,4 @@ +build-config.cfg +src/style.css +src/style.css.map +src/scss/.sass-cache \ No newline at end of file diff --git a/build-config-sample.cfg b/build-config-sample.cfg new file mode 100755 index 0000000..dbbb1e5 --- /dev/null +++ b/build-config-sample.cfg @@ -0,0 +1,2 @@ +# the destination folder, inside the plugins folder of some WordPress installation +destination=~/devel/wordpress/wp-content/themes/tainacan \ No newline at end of file diff --git a/build-watch.sh b/build-watch.sh new file mode 100755 index 0000000..4977df4 --- /dev/null +++ b/build-watch.sh @@ -0,0 +1,11 @@ +#!/bin/sh +## Run the build script whenever there is a change in src folder + + +echo 'Watching changes on src/' + +while inotifywait -qqr src -e create,move,modify,delete; do + echo + echo 'Change detected, running build' + ./build.sh +done \ No newline at end of file diff --git a/build.sh b/build.sh new file mode 100755 index 0000000..a354f3d --- /dev/null +++ b/build.sh @@ -0,0 +1,15 @@ +#!/bin/bash + +source build-config.cfg + +## Compile SASS +sh compile-sass.sh + +## Install composer dependencies +## composer install + +echo "Updating files in $destination" +rm -rf $destination +mkdir $destination +cp -R src/* $destination/ +rm -rf $destination/scss diff --git a/compile-sass.sh b/compile-sass.sh new file mode 100644 index 0000000..938ef38 --- /dev/null +++ b/compile-sass.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# Executa o comando 'sass' para verificar se existe (veja http://stackoverflow.com/a/677212/329911) +command -v sass >/dev/null 2>&1 || { + echo >&2 "SASS parece não está disponivel."; + exit 1; +} + +# Define o caminho. +echo "Compilando Sass..." +cd src/scss + +sass -E 'UTF-8' style.scss:../style.css + +echo "Compilação do Sass Concluído!" +exit 0 diff --git a/src/scss/style.scss b/src/scss/style.scss new file mode 100644 index 0000000..e69de29