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

Make 'yo generate' overwrite yo_db file #61

Merged
merged 1 commit into from
Mar 1, 2021

Conversation

tyamagu2
Copy link
Contributor

@tyamagu2 tyamagu2 commented Feb 5, 2021

yo generate does not overwrite YOTemplate (yo_db) file if the file already exists. This PR makes it overwrite YOTemplate file. I'm not sure why it currently skips writing YOTemplate file, but this change certainly makes it easier to update yo_db.tpl of a project.

Note that it always overwrites YOTemplate content if the single file option is enabled, because Generator.files already has the file pointer when it tries to get the file pointer to write the content.

@google-cla
Copy link

google-cla bot commented Feb 5, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@google-cla
Copy link

google-cla bot commented Feb 5, 2021

Thanks for your pull request. It looks like this may be your first contribution to a Google open source project (if not, look below for help). Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA).

📝 Please visit https://cla.developers.google.com/ to sign.

Once you've signed (or fixed any issues), please reply here with @googlebot I signed it! and we'll verify it.


What to do if you already signed the CLA

Individual signers
Corporate signers

ℹ️ Googlers: Go here for more info.

@tyamagu2
Copy link
Contributor Author

tyamagu2 commented Feb 5, 2021

@googlebot I signed it!

@zchee
Copy link
Contributor

zchee commented Mar 1, 2021

@kazegusuri just ping

fi, err := os.Stat(filename)
if err == nil && fi.IsDir() {
return nil, errors.New("filename cannot be directory")
}

// skip
Copy link
Collaborator

Choose a reason for hiding this comment

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

hmm... I'm not sure why this skips... The mystery is derived from xo.

@kazegusuri kazegusuri merged commit 2e57a58 into cloudspannerecosystem:master Mar 1, 2021
@tyamagu2 tyamagu2 deleted the recreate-yo_db branch March 1, 2021 10:41
zchee pushed a commit to zchee/cloudspannerecosystem-yo that referenced this pull request Mar 1, 2021
zchee pushed a commit to zchee/cloudspannerecosystem-yo that referenced this pull request Mar 1, 2021
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

Successfully merging this pull request may close these issues.

3 participants