setup repository

This commit is contained in:
Leo Germani 2018-01-19 15:06:56 -02:00
parent ee84da129d
commit 6478d45d28
6 changed files with 48 additions and 0 deletions

4
.gitignore vendored Normal file
View File

@ -0,0 +1,4 @@
build-config.cfg
src/style.css
src/style.css.map
src/scss/.sass-cache

2
build-config-sample.cfg Executable file
View File

@ -0,0 +1,2 @@
# the destination folder, inside the plugins folder of some WordPress installation
destination=~/devel/wordpress/wp-content/themes/tainacan

11
build-watch.sh Executable file
View File

@ -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

15
build.sh Executable file
View File

@ -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

16
compile-sass.sh Normal file
View File

@ -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

0
src/scss/style.scss Normal file
View File