tests-always-included / mo

Mustache templates in pure bash
Other
563 stars 67 forks source link

demo script doesn't work #3

Closed rk295 closed 9 years ago

rk295 commented 9 years ago

On Centos 6 version of bash the two variables at the top need to be exported before they are available to mo

% bash --version
GNU bash, version 4.1.2(1)-release (i386-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
% bash important-file
#
# This file automatically generated at
home_ip=

# ALLOWED HOSTS
# No allowed hosts

# DENIED HOSTS
# No denied hosts
% cp important-file important-file.orig
% vi important-file
% diff important-file.orig important-file
8,9c8,9
< IP=127.0.0.1
< ALLOWED_HOSTS=( 192.168.0.1 192.168.0.2 192.168.0.3 )

---
> export IP=127.0.0.1
> export ALLOWED_HOSTS=( 192.168.0.1 192.168.0.2 192.168.0.3 )
% bash important-file
#
# This file automatically generated at
home_ip=127.0.0.1

# ALLOWED HOSTS
# No allowed hosts

# DENIED HOSTS
# No denied hosts
%
fidian commented 9 years ago

Closed per your pull request #4.

fidian commented 9 years ago

Even with #4, the array is not exported properly.

fidian commented 9 years ago

I freshly cloned and the array looks good to me. What about you @rk295?

$ demo/important-file 
# *** OH SO IMPORTANT ***
# This file automatically generated at Wed Jan 28 15:12:14 UTC 2015
home_ip=127.0.0.1

# ALLOWED HOSTS
allowed_host=192.168.0.1
allowed_host=192.168.0.2
allowed_host=192.168.0.3

# DENIED HOSTS
# No denied hosts
$ bash --version
GNU bash, version 4.1.2(1)-release (x86_64-redhat-linux-gnu)
Copyright (C) 2009 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>

This is free software; you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
rk295 commented 9 years ago

:+1: same for me with a clean copy of the repo. My bad.