Skip to content

Commit

Permalink
refactor: naming, spread like other props
Browse files Browse the repository at this point in the history
  • Loading branch information
mshanemc committed Dec 5, 2023
1 parent ab5bc89 commit ca653b0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/commands/project/retrieve/start.ts
Original file line number Diff line number Diff line change
Expand Up @@ -373,7 +373,7 @@ const buildRetrieveAndDeleteTargets = async (
}
return result;
} else {
const retrieveFromOrg = flags.metadata?.some(isWildcard) ? flags['target-org'].getUsername() : undefined;
const retrieveFromOrg = flags.metadata?.some(isRegexMatch) ? flags['target-org'].getUsername() : undefined;

return {
componentSetFromNonDeletes: await ComponentSetBuilder.build({
Expand Down Expand Up @@ -401,7 +401,7 @@ const buildRetrieveAndDeleteTargets = async (
},
}
: {}),
org: retrieveFromOrg ? { username: retrieveFromOrg, exclude: [] } : undefined,
...(retrieveFromOrg ? { org: { username: retrieveFromOrg, exclude: [] } } : {}),
}),
};
}
Expand Down Expand Up @@ -440,7 +440,7 @@ const buildRetrieveOptions = async (
});

// check if we're retrieving metadata based on a pattern ...
const isWildcard = (mdEntry: string): boolean => {
const isRegexMatch = (mdEntry: string): boolean => {
const mdName = mdEntry.split(':')[1];
return mdName?.includes('*') && mdName?.length > 1 && !mdName?.includes('.*');
};

0 comments on commit ca653b0

Please sign in to comment.