fix for using project config for positional args

This commit is contained in:
Laura Liberda 2021-02-24 01:27:03 +01:00
parent b41908f40d
commit 9cc044e6e0

View file

@ -50,7 +50,15 @@ export default class Replicate extends Command {
const { source, dest } = {
...proj,
...(args as {
// oclif does set undefined values for non-existant args
// so we have to filter out these values, or they will replace project config values
...(Object.keys(args)
.filter((ak) => args[ak])
.reduce((acc, curk) => {
acc[curk] = args[curk];
return acc;
}, {} as { [k: string]: string }) as {
source: string;
dest?: string;
}),