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: Check CWD before running commands #71

Open
AgustinSilverfin opened this issue Sep 25, 2023 · 0 comments
Open

CLI: Check CWD before running commands #71

AgustinSilverfin opened this issue Sep 25, 2023 · 0 comments
Labels
feature request New feature or request

Comments

@AgustinSilverfin
Copy link
Contributor

Is your feature request related to a problem? Please describe.

The CLI is intend to be used from the root directory of your repository. If not, it could lead to unexpected results. We should add some checks of the CWD before running any command.

Describe the solution you'd like
The CLI won't run any command if it is not executed in the right directory. Even better, it will automatically switch the CWD to the correct one.

Describe alternatives you've considered
There are two scenarios:

  • Running the CLI command from a directory inside our repository (e.g. /reconciliations_texts/template_handle): In this case, we could identify the root of the repo and switch the CWD before running any command.
  • Running the CLI command from a directory outisde our repository: In this case, how can we identify that we are not placed in the right repository ?
    • Checking the existence of folders like reconciliation_texts ? What if it's a new repository ?
    • Checking the existence of a git repository ?
    • Should we create some kind of configuration file at the root of the folder that we can search for ?
    • I would use a combination of the first two: if there are no related folders, don't prevent the run of the commands but show a warning. If there is no git repository, prevent the run and show the error, asking to move to the right path.

Originally raised by @MelSFNL

@AgustinSilverfin AgustinSilverfin added the feature request New feature or request label Sep 25, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
feature request New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant