sdk-for-cli icon indicating copy to clipboard operation
sdk-for-cli copied to clipboard

🚀 Feature: Give a hint to where you should run init and deploy commands

Open stnguyen90 opened this issue 1 year ago • 9 comments

🔖 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?

stnguyen90 avatar Aug 02 '23 19:08 stnguyen90

@gewenyu99, suggestions on the error?

stnguyen90 avatar Aug 02 '23 19:08 stnguyen90

Hi, if it's not assigned I'd like to work on this issue

adarshjhaa100 avatar Aug 03 '23 12:08 adarshjhaa100

@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?

gewenyu99 avatar Aug 03 '23 14:08 gewenyu99

@adarshjhaa100, assigned! Thanks for your interest! 🙏🏼

stnguyen90 avatar Aug 18 '23 22:08 stnguyen90

@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.:

image

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.

adarshjhaa100 avatar Aug 19 '23 19:08 adarshjhaa100

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 avatar Aug 21 '23 19:08 stnguyen90

@stnguyen90 I'll raise a PR for this in the SDK Generator within a couple of days.

adarshjhaa100 avatar Sep 22 '23 20:09 adarshjhaa100

@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.

adarshjhaa100 avatar Sep 25 '23 17:09 adarshjhaa100

@stnguyen90 pushed the latest changes to this PR: https://github.com/appwrite/sdk-generator/pull/720

adarshjhaa100 avatar Oct 18 '23 12:10 adarshjhaa100