Skip to content
This repository has been archived by the owner on Nov 15, 2020. It is now read-only.

Allow multiple variables #15

Open
wants to merge 16 commits into
base: master
Choose a base branch
from
Open

Allow multiple variables #15

wants to merge 16 commits into from

Conversation

taylonr
Copy link
Contributor

@taylonr taylonr commented Apr 2, 2017

If the template file has multiple variable declarations, the user was only asked to supply the last variable. Because only one variable was asked to be defined, the Promise.all never gets resolved and the file doesn't get created.

By extracting to a recursive function, the user will now be prompted to enter a value for every variable, and only after they're all supplied will the file be written.

An example template file used to test this:

#{another_test}
function a() {
    #{test1}

    #{test2}
    var z = 1;
    var y = 2;
    var x = z;
    let b = x + y;
    console.log(b);
    return b;
}

@brunetton
Copy link

Thanks @taylonr, I'll test it as I'm having exactly the same problem

@alexnum
Copy link

alexnum commented Mar 28, 2018

Is there any excepted date to the next release with this feature?

Copy link

@nicoesiea nicoesiea left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

+1

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants