sdk-for-cli
sdk-for-cli copied to clipboard
🚀 Feature: Give a hint to where you should run init and deploy commands
🔖 Feature description
appwrite init [subcommand]
and appwrite deploy [subcommand]
need to be executed in a folder that contains an appwrite.json
file so that that file can be used for the init and deploy, but if you run it from a directory that doesn't contain the file, you might get a cryptic error message like:
$ appwrite deploy function
✗ Error No functions found in the current directory.
🎤 Pitch
The init and deploy commands should check for an appwrite.json file and if it doesn't exist, provide an error:
appwrite.json file not found. Please run this command in a folder with an appwrite.json file.
👀 Have you spent some time to check if this issue has been raised before?
- [X] I checked and didn't find similar issue
🏢 Have you read the Code of Conduct?
- [X] I have read the Code of Conduct
@gewenyu99, suggestions on the error?
Hi, if it's not assigned I'd like to work on this issue
@gewenyu99, suggestions on the error?
✗ Error: No appwrite.json file found in the current directory. This command must be run in the folder holding your appwrite.json file. Please run this command again in the folder containing your appwrite.json file, or run [command to init appwrite.json].
@stnguyen90 how's this?
@adarshjhaa100, assigned! Thanks for your interest! 🙏🏼
@stnguyen90 I have replaced the error message for the appwrite deploy [subcommand]
for all of the available components where I observed the cryptic message ( function, collection, bucket, team ) e.g.:
But, for the appwrite init [subcommand]
, it displays the following error message which seems to be appropriate to me:
✗ Error Project is not set. Please run appwrite init project to initialize the current directory with an Appwrite project.
Do let me know if anything needs to be changed here and I'll make them before raising the PR.
But, for the
appwrite init [subcommand]
, it displays the following error message which seems to be appropriate to me:✗ Error Project is not set. Please run appwrite init project to initialize the current directory with an Appwrite project.
That sounds reasonable. Go ahead and submit the PR.
@stnguyen90 I'll raise a PR for this in the SDK Generator within a couple of days.
@stnguyen90 Have made the changes and raised the PR to SDK generator with attached test cases. Do let me know if there's any issue with the PR and I'll promptly fix and reply.
@stnguyen90 pushed the latest changes to this PR: https://github.com/appwrite/sdk-generator/pull/720