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:
parent
901ef8ecd6
commit
91906f0ebf
2 changed files with 9 additions and 0 deletions
5
.changeset/wise-dingos-compete.md
Normal file
5
.changeset/wise-dingos-compete.md
Normal file
|
@ -0,0 +1,5 @@
|
|||
---
|
||||
"@logto/cli": patch
|
||||
---
|
||||
|
||||
use current directory as instance path if no path input for cli
|
|
@ -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'));
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue