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

cli(app/create): Ask for directory to create the app in #4883

Merged
merged 2 commits into from
Jun 21, 2024

Conversation

xdoardo
Copy link
Contributor

@xdoardo xdoardo commented Jun 21, 2024

This PR introduces a mechanism that asks users the directory they want to save their app in in case the default app directory is not empty.

A bit more context:

Currently "wasmer app create" assumes that you just want to use the current directory.
This is not how most users will usually use this.

They won't do: mkdir bla; cd bla; wasmer app create.
Rather they will want to do wasmer app create , and have the result in bla.
The command should prompt for a target directory (with it optionally being .).
Should also have a flag to specify it in non-interactive mode.
The default should probably remain . to not break things, also in non-interactive mode.

@xdoardo xdoardo requested a review from syrusakbary as a code owner June 21, 2024 06:54
@syrusakbary
Copy link
Member

@xdoardo I assume this doesn’t affect the behavior of Wasmer deploy in a full dir, right?

@xdoardo
Copy link
Contributor Author

xdoardo commented Jun 21, 2024

If running wasmer deploy does not end up calling wasmer app create then no, it does not change. If wasmer deploy is called in a directory that does not contain a manifest (nor an app.yaml) then it falls back to wasmer app create which will eventually ask the user a directory to store their app in.

Note, however, that creating apps from existing directories was previously explicitly unsupported. In the near future we'll want to adopt a create mechanism (and thus a deploy mechanism as well) that allows to create an app from an existing project with no manifest, if I understood correctly.

@syrusakbary
Copy link
Member

then it falls back to wasmer app create which will eventually ask the user a directory to store their app in.

So, it will affect? Basically for wasmer deploy in a directory with files and without a app.yaml it should prompt to deploy the own directory. While wasmer app create can prompt to create in a new directory. Both behaviors should work well @xdoardo

@syrusakbary
Copy link
Member

I got confused here. Chatted with @xdoardo and we are in alignment with this solution. Approving

@syrusakbary syrusakbary merged commit bd6d84a into main Jun 21, 2024
62 checks passed
@syrusakbary syrusakbary deleted the wax-180-new-directory-when-creating-an-app branch June 21, 2024 14:25
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.

2 participants