0
Fork 0
mirror of https://github.com/logto-io/logto.git synced 2025-03-03 22:15:32 -05:00

Merge pull request #3685 from logto-io/gao-cli-use-current-dir

refactor(cli): use current directory as instance path if no input
This commit is contained in:
Gao Sun 2023-04-11 00:09:16 +08:00 committed by GitHub
commit 1ac2582834
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 9 additions and 0 deletions

View file

@ -0,0 +1,5 @@
---
"@logto/cli": patch
---
use current directory as instance path if no path input for cli

View file

@ -53,6 +53,10 @@ const validatePath = async (value: string) => {
export const inquireInstancePath = async (initialPath?: string) => {
const inquire = async () => {
if (!initialPath && (await validatePath('.')) === true) {
return path.resolve('.');
}
if (!isTty()) {
assert(initialPath, new Error('Path is missing'));