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:
commit
1ac2582834
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