Skip to content

Commit eaf324c

Browse files
committed
Refactor package command to use ThemeCommand's run method
Previously, theme package command implemented its own run logic. This commit refactors package to use ThemeCommand's base run() method. This will help to standardize command architecture
1 parent b58268b commit eaf324c

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/theme/src/cli/commands/theme/package.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,9 @@ import {themeFlags} from '../../flags.js'
22
import ThemeCommand from '../../utilities/theme-command.js'
33
import {packageTheme} from '../../services/package.js'
44
import {globalFlags} from '@shopify/cli-kit/node/cli'
5+
import {InferredFlags} from '@oclif/core/interfaces'
56

7+
type PackageFlags = InferredFlags<typeof Package.flags>
68
export default class Package extends ThemeCommand {
79
static summary = 'Package your theme into a .zip file, ready to upload to the Online Store.'
810

@@ -21,8 +23,7 @@ export default class Package extends ThemeCommand {
2123
path: themeFlags.path,
2224
}
2325

24-
async run(): Promise<void> {
25-
const {flags} = await this.parse(Package)
26+
async command(flags: PackageFlags) {
2627
await packageTheme(flags.path)
2728
}
2829
}

0 commit comments

Comments
 (0)