Skip to content

Commit

Permalink
Fix bug when using --nodelete flag on dev command
Browse files Browse the repository at this point in the history
This fixes an issue where the --nodelete flag was not being respected when
running the dev command. This was due to the fact that the flag was not
being passed to the theme-fs utility function.
  • Loading branch information
EvilGenius13 committed Oct 18, 2024
1 parent fac882b commit 689aeac
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions packages/cli-kit/src/public/node/themes/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ export type ThemeFSEventPayload<T extends ThemeFSEventName = 'add'> = (ThemeFSEv
export interface ThemeFileSystemOptions {
filters?: {ignore?: string[]; only?: string[]}
notify?: string
noDelete?: boolean
}

/**
Expand Down
1 change: 1 addition & 0 deletions packages/theme/src/cli/services/dev.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ export async function dev(options: DevOptions) {
const localThemeFileSystem = mountThemeFileSystem(options.directory, {
filters: options,
notify: options.notify,
noDelete: options.noDelete,
})

const host = options.host || DEFAULT_HOST
Expand Down
2 changes: 1 addition & 1 deletion packages/theme/src/cli/utilities/theme-fs.ts
Original file line number Diff line number Diff line change
Expand Up @@ -187,7 +187,7 @@ export function mountThemeFileSystem(root: string, options?: ThemeFileSystemOpti
}

const handleFileDelete = (themeId: string, adminSession: AdminSession, fileKey: string) => {
if (isFileIgnored(fileKey)) return
if (isFileIgnored(fileKey) || options?.noDelete) return

// Optimistically delete the file from the local file system.
files.delete(fileKey)
Expand Down

0 comments on commit 689aeac

Please sign in to comment.