Skip to content

Commit

Permalink
feat: Allow single args for plural args for some commands
Browse files Browse the repository at this point in the history
  • Loading branch information
pike authored and pike committed Mar 24, 2024
1 parent eea2115 commit 72840ca
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions src/services/CommandHandler.ts
Original file line number Diff line number Diff line change
Expand Up @@ -205,6 +205,12 @@ class CommandHandler {
break;
}
case "prepare-posts": {
if (!args.platforms && args.platform) {
args.platforms = [args.platform];
}
if (!args.folders && args.folder) {
args.folders = [args.folder];
}
const prepposts = await feed.preparePosts({
folders: args.folders,
platforms: args.platforms,
Expand Down Expand Up @@ -244,6 +250,12 @@ class CommandHandler {
break;
}
case "schedule-posts": {
if (!args.platforms && args.platform) {
args.platforms = [args.platform];
}
if (!args.folders && args.folder) {
args.folders = [args.folder];
}
if (!args.folders) {
throw user.error(
"CommandHandler " + command,
Expand Down Expand Up @@ -292,6 +304,12 @@ class CommandHandler {
break;
}
case "publish-posts": {
if (!args.platforms && args.platform) {
args.platforms = [args.platform];
}
if (!args.folders && args.folder) {
args.folders = [args.folder];
}
if (!args.folders) {
throw user.error(
"CommandHandler " + command,
Expand Down

0 comments on commit 72840ca

Please sign in to comment.