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

Subo 'create' command still makes a directory if it fails to find a template #119

Closed
danielledeleo opened this issue Nov 16, 2021 · 3 comments · Fixed by #135
Closed

Subo 'create' command still makes a directory if it fails to find a template #119

danielledeleo opened this issue Nov 16, 2021 · 3 comments · Fixed by #135
Labels
bug Something isn't working good first issue Good for newcomers

Comments

@danielledeleo
Copy link
Contributor

Replication steps:

subo create runnable foobar --lang somethingnotsupported

Which still creates a foobar folder even though it failed.

@danielledeleo danielledeleo added bug Something isn't working good first issue Good for newcomers labels Nov 16, 2021
@denopink
Copy link
Contributor

Got it replicated on my end. I'll try my hand at the patch.

@denopink
Copy link
Contributor

denopink commented Nov 23, 2021

@jagger27 if subo create runnable fails, then wouldn't we want to delete the output dir all together (in this case we'll be deleting foobar and its contents) for any reason and not just for the current case writeDotRunnable: somethingnotsupported is not an available language?

@danielledeleo
Copy link
Contributor Author

@jagger27 if subo create runnable fails, then wouldn't we want to delete the output dir all together (in this case we'll be deleting foobar and its contents) for any reason and not just for the current case writeDotRunnable: somethingnotsupported is not an available language?

Yes that seems reasonable.

denopink added a commit to denopink/subo that referenced this issue Nov 23, 2021
…Cmd failures

Based on the conv in suborbital#119,  we want to delete the output dir of `sudo create runnable` for any failure that occurs in `CreateRunnableCmd`.

`CreateRunnableError`s `Error` will also act as a cleanup function for these failures. atm, it's only deleting the output dir.

Ideally, cobra.Command would have a error callback feature... maybe we'll get one for Xmas. spf13/cobra#914
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working good first issue Good for newcomers
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants