Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/commands/list.ts
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ export default class List extends Command {

let folderUuid = await this.getFolderUuid(flags['id'], nonInteractive);

if (folderUuid.trim().length === 0) {
if (!folderUuid || folderUuid.trim().length === 0) {
// folderId is empty from flags&prompt, which means we should use RootFolderUuid
folderUuid = userCredentials.root_folder_uuid;
}
Expand Down Expand Up @@ -114,7 +114,7 @@ export default class List extends Command {
this.exit(1);
}

public getFolderUuid = async (folderUuidFlag: string | undefined, nonInteractive: boolean): Promise<string> => {
public getFolderUuid = async (folderUuidFlag: string | undefined, nonInteractive: boolean): Promise<string | undefined> => {
let folderUuid = CLIUtils.getValueFromFlag(
{
value: folderUuidFlag,
Expand All @@ -125,7 +125,7 @@ export default class List extends Command {
nonInteractive,
(folderUuid: string) => ValidationService.instance.validateUUIDv4(folderUuid),
);
if (!folderUuid) {
if (!folderUuid && !nonInteractive) {
folderUuid = (await this.getFolderUuidInteractively()).trim();
}
return folderUuid;
Expand Down
Loading