roboshoes / grunt-json-bake

Grunt plugin that lets you merge multiple JSON files into one.
MIT License
7 stars 3 forks source link

Empty string variable not recognized as variable during transformation #7

Closed mfidemraizer closed 8 years ago

mfidemraizer commented 8 years ago

I've found that providing a variable holding an empty string will result in a warning like this:

No variable definition found for: gitBranchPrefix

Where gitBranchPrefix is the whole variable configured as follows:

   development: {
                files: {
                    "./app/js/config/app.config.json": "./app/js/config/_app.config.json"
                },
                options: {
                    variables: {
                        target: "development",
                        gitBranchPrefix: gitBranchPrefix
                    }
                }
            }

It would be interesting to support this scenario, because sometimes you want to use some variable and, depending on the use case, maybe you want it to print an empty string.

Actually, it works as expected. The issue is the warning :)

roboshoes commented 8 years ago

Hey there,

That is a good point. the way I check for the variable to exist is not safe for empty strings (line 168).

I will update that. Thanks.

mfidemraizer commented 8 years ago

Thank you ;)