Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Boolean variables from .scaraplate.conf incorrectly works #23

Open
rusdevops opened this issue Mar 21, 2024 · 0 comments
Open

Boolean variables from .scaraplate.conf incorrectly works #23

rusdevops opened this issue Mar 21, 2024 · 0 comments

Comments

@rusdevops
Copy link

rusdevops commented Mar 21, 2024

Makefile

{% if cookiecutter.use_proto %}
.PHONY: proto
proto:
  protoc --go_out=. proto/go_example_api.proto
{% endif %}

hooks/post_gen_project.py

def main():

  use_proto = "{{cookiecutter.use_proto}}"
  print("!!!", use_proto)
{% if cookiecutter.use_proto %}
    make = Popen(["make", "proto"], cwd=PROJECT_DIRECTORY)
    make.wait()
{% else %}

make proto is not called (good)

# create repo
$ scaraplate rollup go-project-template go-example-api
`go-example-api/.scaraplate.conf` file doesn't exist

!!! False

$ cat go-example-api/.scaraplate.conf

use_proto = False

make proto is called (bad)

# update repo
scaraplate rollup go-project-template go-example-api
Continuing with the following context from the `go-example-api/.scaraplate.conf` file:
// ...
'use_proto': 'False',

!!! False
 
protoc --go_out=. proto/go_example_api.proto

Expected behavior:
make proto will not be called when updating

Environment:

$ scaraplate --version
scaraplate, version 0.5

$ cookiecutter --version
Cookiecutter 2.6.0
@rusdevops rusdevops changed the title Reads Boolean variables incorrectly from .scaraplate.conf Boolean variables from .scaraplate.conf incorrectly works Mar 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant