commit 57a3d8292067c62cf013aa83670bff2a1e0a6287
parent 405bbd3c0ca4afce3a890ae6e4c59035cb05a033
Author: parazyd <parazyd@dyne.org>
Date: Fri, 17 Jun 2016 13:29:32 +0200
more pleasant experience
Diffstat:
M | mars.sh | | | 26 | +++++++++++++++++--------- |
1 file changed, 17 insertions(+), 9 deletions(-)
diff --git a/mars.sh b/mars.sh
@@ -17,19 +17,21 @@
#
# You should have received a copy of the GNU General Public License
# along with this source code. If not, see <http://www.gnu.org/licenses/>.
-
+autoload colors; colors
source webtree
generate() {
- print "${fg[green]}(*) generating your static pages..."
+ print "${fg[green]}(*) generating your static pages${reset_color}"
for dir in $tree; do
pushd $dir
pages=($(ls *.php))
+ print "${fg[blue]} -- /$dir --${reset_color}"
+
for page in $pages; do
if [[ -n "${exclude[(r)$page]}" ]]; then
- print "${fg[yellow]}(*) $page found in excludes, skipping..."
+ skip-page
else
process-page
fi
@@ -40,23 +42,29 @@ generate() {
}
process-page() {
- print "${fg[green]}(*) processing $page..."
name=${page[(ws:.:)1]}
php -f $page > $name.html \
- && print "$name.php -> $name.html [ ${fg[green]}OK${reset_color} ]" \
- || print "$name.php -> $name.html [${fg[red]}NOPE${reset_color}]"
+ && print "[ ${fg[green]}OK${reset_color} ] $name.php -> $name.html" \
+ || print "[${fg[red]}NOPE${reset_color}] $name.php -> $name.html "
+}
+
+skip-page() {
+ name=${page[(ws:.:)1]}
+ print "[${fg[yellow]}SKIP${reset_color}] $name.php -> $name.html"
}
clean() {
- print "${fg[green]}(*) cleaning..."
+ print "${fg[green]}(*) cleaning...${reset_color}"
for dir in $tree; do
pushd $dir
pages=($(ls *.php))
+ print "${fg[blue]} -- /$dir --${reset_color}"
+
for page in $pages; do
if [[ -n "${exclude[(r)$page]}" ]]; then
- print "${fg[yellow]}(*) $page found in excludes, skipping..."
+ print "${fg[yellow]}(*) skipping ${page}${reset_color}"
else
name=${page[(ws:.:)1]}
printf "(*) "
@@ -69,7 +77,7 @@ clean() {
}
push() {
- print "${fg[green]}(*) rsyncing website..."
+ print "${fg[green]}(*) rsyncing website...${reset_color}"
rsync -P -e 'ssh' -avl --delete --stats --progress \
--exclude-from 'rsync-exclude' \