Commit Graph

93 Commits

Author SHA1 Message Date
Alexey Maslennikov
31b2faf135 Fixing empty variable failure for --fail-not-set 2017-06-16 15:59:57 +02:00
Alexey Maslennikov
2b611b8f90 Making --fail-not-set work with partials
The return code was not propagated through nested subshells in case
when files were passed in as arguments.
2017-06-16 10:50:18 +02:00
Alexey Maslennikov
50aa18e2a6 Adding an option to fail upon unset env variables 2017-06-16 10:47:31 +02:00
Tyler Akins
4ccfaf9d79
Making work in strict mode and fixing len bug 2017-04-21 12:19:21 -05:00
Tyler Akins
8142f70769
Fixing indentation of partials 2017-04-21 09:30:32 -05:00
Tyler Akins
c2979c0fb8
Fixing bug with array substrings
Found on tests-always-included/wick#113
This was the solution first suggested by fidian/gg-core#7
2017-02-23 13:51:12 -06:00
Tyler Akins
a97368c74f
Fixing the array slicing for Bash 3
This IFS problem only happens on Bash 3 in some circumstances.
2017-02-21 11:00:39 -06:00
Tyler Akins
ecfc973c2f
Fixing --source to parse the right argument
This is addressing #12
2016-12-20 07:27:06 -06:00
Tyler Akins
410883c85d
Updates for style and to fix exit on error in some contexts 2016-12-15 18:11:29 -06:00
Tyler Akins
05110ce3ca
Treating BASH_SOURCE like an array 2016-10-25 06:11:33 -05:00
Tyler Akins
9b76cadefb
Logically simpler, functionally equivalent. 2016-10-25 05:59:52 -05:00
Tyler Akins
57663d7d34
Updating to match newer version of shellcheck 2016-10-25 05:56:40 -05:00
Tyler Akins
c6bbf89f84 Fixing things reported by shellcheck 2016-08-03 10:19:43 -05:00
Tyler Akins
1c03949107 Enabling a "false is empty" style check.
This is based off of pull request #10 from @athieriot.
Thanks for the idea!  I've implemented it as a flag and an environment
variable that can be enabled.  I've also added another test to handle
the environment variable.
2016-07-27 09:56:33 -05:00
Tyler Akins
ea76dc468b Handling double-hyphens 2016-07-21 09:47:37 -05:00
Tyler Akins
2888626334 Bash 3 syntax and slight adjustments mostly for code style 2016-07-21 09:34:02 -05:00
Alexandre-Silva
45475ec77e Add test for --source flag and pull request suggestions
Add a demo/sourcing.vars file to be used by the associated demo
script.

Modified mo argument parsing so that --help and --source=file do not need
to be the first arguments for mo. And can in fact appear after or in the
middle of filenames.
2016-07-21 15:16:46 +01:00
Alexandre-Silva
f9aea51163 mo can now source a script before parsing templates 2016-07-21 12:47:26 +01:00
Tyler Akins
a1e22f1814 Removing an unnecessary redirection 2015-12-21 09:03:10 -06:00
Tyler Akins
4e0c6894b4 Fixing a quoting issue 2015-12-21 09:02:42 -06:00
Tyler Akins
d8141aabaa '*' may flag Markdown as italics 2015-10-07 15:23:50 -05:00
Tyler Akins
ddf6d79a14 Renaming variables
Ones that are all uppercase can conflict with system variables.  Using
lower case or camelCase variables will ensure we will never conflict
with these predefined values.
2015-10-02 10:47:53 -05:00
Tyler Akins
b5faf67737 Reformat comments into TomDoc format 2015-10-02 10:04:30 -05:00
Tyler Akins
851e619fbd Renaming all functions
This makes function names POSIX compliant.  Not a big deal with bash,
but very important if you want to use tools like ctags or tomdoc.sh.
2015-10-02 09:46:24 -05:00
Tyler Akins
e623b16bb8 Allowing access to globals while in a loop
This used to make a name like DATA.0.STR.  Since bash doesn't like using
multi-dimensional arrays, we can shortcut things and just assume that
STR referes to the global variable here.

This closes issue #7
2015-08-27 09:43:10 -05:00
Tyler Akins
70cc736b4a Must have IFS set properly
This lets the value returned from mustache-is-standalone get parsed
correctly.  When this is a standalone template, the value returned looks
like "12 34" where each number is a position.  Later, this is used in a
line that looks like `( $VALUE_RETURNED )`.  When IFS does not contain a
space, this array is not built correctly.
2015-08-21 11:56:52 -05:00
Tyler Akins
5dfb1cd96a Better associative array handling
Bug:  Did not properly detect the length of an array in mustache-test
because I neglected to use `[@]` after the array name.  This closes
issue #6.

Feature:  Made {{ARRAY_NAME}} implode array values with commas.

Feature:  Added an associative array demo script.
2015-05-05 10:46:06 -05:00
Tyler Akins
3516cdd631 Removing Bourne shell-ism (bash doesn't have this issue) 2015-02-13 11:38:03 +00:00
Tyler Akins
dac224cc7a Removing negative indices
This closes issue #2
2015-01-27 10:41:16 -06:00
Tyler Akins
0bd1832eb1 Removing another unneeded parameter 2015-01-27 09:49:11 -06:00
Tyler Akins
bc5c313828 Minor bugfixes found while writing more tests 2015-01-27 09:46:40 -06:00
Tyler Akins
9ad785ff32 Removed one global variable 2015-01-27 08:29:08 -06:00
Tyler Akins
d387141473 Adding header to file to point to repo 2015-01-27 06:05:06 -06:00
Tyler Akins
68c3141678 Alphabetiation of functions
Oh my goodness, it needed some sort of organiation in there.
2015-01-26 19:55:06 -06:00
Tyler Akins
b469554ac1 Avoid newline indentation with empty indent string 2015-01-26 18:23:28 -06:00
Tyler Akins
a9f65f65ed Rewrote partials, all blocks support standalone
Blocks supporting standalone end tags was a matter of saying that this
could have been the beginning of the content.

Rewrote all partials to do in-bash string processing in order to add the
indent characters to all lines that have content.

Failing 28 out of 123 tests.  At this point I have looked at all of the
tests and feel confident that they are because of features that are
intentionally not supported.
2015-01-26 15:09:27 -06:00
Tyler Akins
dc33657284 Removing unneeded parameter 2015-01-26 13:05:28 -06:00
Tyler Akins
5aa22680f5 Adding better block detection
Pulled the block finding code into its own function to eliminate a
recursion problem.

Test failure count dropped because lambdas are supported and I just
needed to update the spec.  Pull request mustache/spec#86 aims to add
bash support.  Until then, the testing script will fall back to using
perl.

34 failing tests
2015-01-26 12:51:28 -06:00
Tyler Akins
1e26c691b9 Fixing newlines, removing unnecessary quotes
* Trailing newline after a standalone tag can be "\r\n".
* Correctly returns the right number of characters to remove if the
standalone tag is at the end of the input (0 vs 1, didn't affect
behavior)

45 tests fail
2015-01-26 14:50:07 +00:00
Tyler Akins
8ee909f8de Adding some support for standalone tags
Failing test count is down about 5.  Currently at 57 / 122 failures
2015-01-26 03:31:21 +00:00
Tyler Akins
464733444a Adding support for &
This fixes 6 official tests
2015-01-23 20:26:56 +00:00
Tyler Akins
b097733ffd Move file loading to a separate function 2015-01-23 18:06:24 +00:00
Tyler Akins
1151ec0a9e Initial commit 2015-01-23 17:43:08 +00:00