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

bug(create-neon): Answering "no" leaves partial project on disk #706

Closed
kjvalencik opened this issue Mar 24, 2021 · 6 comments
Closed

bug(create-neon): Answering "no" leaves partial project on disk #706

kjvalencik opened this issue Mar 24, 2021 · 6 comments

Comments

@kjvalencik
Copy link
Member

The end of the npm init prompts ask if the package.json looks correct. Users may answer "no" and it terminates the child process with an exit code of 1. create-neon properly aborts the remainder of the init; however, it has already created the directory and a partial package.json.

create-neon should delete the partial project directory on a non-zero exit code.

@Caryyon
Copy link

Caryyon commented May 17, 2021

Is this issue still valid? I just used neon new foo to test this, and it no longer gives me an option to give a 'yes' or 'no.'
Happy to jump on this, but I believe it's been fixed.

@kjvalencik
Copy link
Member Author

@Caryyon Yes, this is still an issue. neon new foo and npm init neon foo are two different packages.

The neon CLI corresponds with cli/ in the source repo and is deprecated. This issue is for create-neon/ and is the recommended way to create a new Neon project.

To reproduce, run npm init neon my-project and then terminate in any way:

  • Answering, "no"
  • Ctrl+C
  • kill the process

All of them will leave files on disk.

This should likely be implemented by initializing the project in a temp directory and once successfully bootstrapped, move the directory to the target location. We can try to delete the temp directory if the internal npm init exits with a non-zero code, but even if that fails or the process is killed, at worst we've left files in /tmp.

@Caryyon
Copy link

Caryyon commented May 21, 2021

I'll work on this!

@kjvalencik
Copy link
Member Author

Awesome! Thanks so much!

@dherman
Copy link
Collaborator

dherman commented Sep 15, 2021

@Caryyon Are you still interested in working on this? Let us know if you got stuck somewhere and we'd be happy to help.

deepanshu44 added a commit to deepanshu44/neon that referenced this issue Jan 6, 2022
deepanshu44 added a commit to deepanshu44/neon that referenced this issue Jan 6, 2022
deepanshu44 added a commit to deepanshu44/neon that referenced this issue Jan 6, 2022
deepanshu44 added a commit to deepanshu44/neon that referenced this issue Jan 6, 2022
deepanshu44 added a commit to deepanshu44/neon that referenced this issue Jan 11, 2022
deepanshu44 added a commit to deepanshu44/neon that referenced this issue Jan 11, 2022
deepanshu44 added a commit to deepanshu44/neon that referenced this issue Jan 11, 2022
deepanshu44 added a commit to deepanshu44/neon that referenced this issue Jan 14, 2022
deepanshu44 added a commit to deepanshu44/neon that referenced this issue Jan 14, 2022
kjvalencik pushed a commit that referenced this issue Feb 19, 2022
create-neon now deletes the partial project directory on non-zero exit code
@kjvalencik
Copy link
Member Author

This was fixed!

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

No branches or pull requests

3 participants