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

refactor(cli): use current directory as instance path if no path input for cli

This commit is contained in:
Gao Sun 2023-04-08 17:24:15 +08:00
parent 901ef8ecd6
commit 91906f0ebf
No known key found for this signature in database
GPG key ID: 13EBE123E4773688
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'));