Skip to content

Commit

Permalink
Fix for empty frontmatter
Browse files Browse the repository at this point in the history
  • Loading branch information
sourishkrout committed Feb 6, 2025
1 parent dcebf7b commit 8eadbf7
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/extension/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -198,14 +198,15 @@ export interface IExecKeyInfo {
export function getKeyInfo(
runningCell: vscode.TextDocument,
cellAnnotations: CellAnnotations,
parsedNotebookFrontmatter: { [key: string]: any },
parsedNotebookFrontmatter: { [key: string]: any } | undefined,
): IExecKeyInfo {
try {
if (!cellAnnotations.background && isDaggerCall(runningCell.getText())) {
return { key: 'daggerCall', resource: 'DaggerObject' }
}

if (!cellAnnotations.background && isDaggerShell(parsedNotebookFrontmatter.shell)) {
const frontmatterShell = parsedNotebookFrontmatter?.shell ?? ''
if (!cellAnnotations.background && isDaggerShell(frontmatterShell)) {
return { key: 'daggerShell', resource: 'None' }
}

Expand Down

0 comments on commit 8eadbf7

Please sign in to comment.