Skip to content

Commit

Permalink
feat(CLI): remove --publish
Browse files Browse the repository at this point in the history
  • Loading branch information
BibiSebi committed Oct 3, 2024
1 parent 2d2718a commit a5a690e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 13 deletions.
12 changes: 4 additions & 8 deletions packages/cli/src/commands/deploy/helper.ts
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ type UpsertFieldPluginFunc = (args: {
packageName: string
output: string
skipPrompts: undefined | boolean
publish: undefined | boolean
publish: boolean
}) => Promise<{ id: number }>

type GetPackageName = (params: {
Expand Down Expand Up @@ -422,20 +422,16 @@ export const createFieldPlugin = async (
// Publish Logic

type CheckPublish = (params: {
publish: undefined | boolean
publish: boolean
skipPrompts: undefined | boolean
}) => Promise<boolean>

export const checkPublish: CheckPublish = async ({ publish, skipPrompts }) => {
if (skipPrompts === true) {
//NOTE: Publish true is the default value
return publish || true
}

if (publish !== undefined) {
if (skipPrompts === true || publish === false) {
return publish
}

//NOTE: In interactive mode where --no-publish is not provided, the user is asked to confirm the publish action.
const publishConfirmation = await confirmPublish()
return publishConfirmation
}
Expand Down
2 changes: 1 addition & 1 deletion packages/cli/src/commands/deploy/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { Scope } from '../../storyblok/storyblok-client'
export type DeployArgs = {
skipPrompts: boolean
dir: string
publish: undefined | boolean
publish: boolean
name: undefined | string
token: undefined | string
output: undefined | string
Expand Down
4 changes: 0 additions & 4 deletions packages/cli/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,6 @@ export const createCLI = () => {
'--name <value>',
'name of plugin (Lowercase alphanumeric and dash)',
)
.option(
'--publish',
'This flag is only applied when a plugin is being updated! Publishes a new version of the plugin.',
)
.option(
'--no-publish',
'This flag is only applied when a plugin is being updated! Uploads field plugin but does not publish a new version.',
Expand Down

0 comments on commit a5a690e

Please sign in to comment.