Skip to content

Commit

Permalink
Fix create environment when name isn't defined
Browse files Browse the repository at this point in the history
  • Loading branch information
corker committed Aug 25, 2024
1 parent 05f75c3 commit 4f3eea4
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/micromamba/pickMicromambaEnvironmentFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,11 @@ export const readMicromambaEnvironmentFile = async (
const filePath = join(extContext.workspaceDir, fileName)
try {
const contentYaml = await fs.promises.readFile(filePath, 'utf8')
const content = YAML.parse(contentYaml) as MicromambaEnvironmentFileContent
const rawContent = YAML.parse(contentYaml) as MicromambaEnvironmentFileContent
const content = rawContent.name ? rawContent : {
...rawContent,
name: 'default'
}
return { content, fileName, filePath }
} catch (ignore) {
return undefined
Expand Down

0 comments on commit 4f3eea4

Please sign in to comment.