Skip to content

CLI should work properly when supabase is the working directory  #517

Closed

Description

@osaxma

Feature request

The CLI command(s) should work properly when supabase is the working directory.

Issue

The behavior when running supbase <command> from within supabase directory varies between unexpected behavior to errors. I haven't tried all the commands but the following are two examples:

Example 1: supabase create functions

  • Run the following series of commands:

    ~ mkdir supabase_project
    ~ cd supabase_project 
    ~ supabase init
    ~ supabase functions new from_top_level
    ~ cd supabase
    ~ supabase functions new from_supabase_dir
  • Run tree for supabase_project to see the result:

    supabase_project/
    └── supabase
        ├── config.toml
        ├── functions
        │   └── from_top_level
        │       └── index.ts
        └── supabase
            └── functions
                └── from_supabase_dir
                    └── index.ts

    As you can see above, the when running supabase functions new from within supabase_project/supabase, it created a new supabase directory (i.e., supabase_project/supabase/supabase/functions).

Example 2: supabase start

supabase start works fine when the working directory is supabase_project, but it'll print the following error when running from within supabase_project/supabase directory:

Error: Cannot find supabase/config.toml in the current directory. Have you set up the project with supabase init?

Describe the solution you'd like

I would like the CLI to work properly within both supabase_project and supabase_project/supabase.

Alternatively, the CLI should detect that the working directory is invalid for all commands equally.

Additional context

cli version: 1.7.7

Activity

  1. added
    enhancement
    on Oct 12, 2022
  2. sweatybridge commented on Oct 12, 2022

    @sweatybridge
    Contributor

    related #329

  3. github-actions commented on Oct 13, 2022

    @github-actions
    Contributor

    🎉 This issue has been resolved in version 1.8.2 🎉

    The release is available on:

    Your semantic-release bot 📦🚀

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions