Skip to content

Commit

Permalink
also require name property (devcontainers#447)
Browse files Browse the repository at this point in the history
  • Loading branch information
joshspicer committed Mar 15, 2023
1 parent 1473080 commit e3d12b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/spec-node/collectionCommonUtils/packageCommandImpl.ts
Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,8 @@ export async function packageSingleFeatureOrTemplate(args: PackageCommandInput,
}

const metadata = jsonc.parse(await readLocalFile(jsonPath, 'utf-8'));
if (!metadata.id || !metadata.version) {
output.write(`${collectionType} is missing an id or version in its devcontainer-${collectionType}.json`, LogLevel.Error);
if (!metadata.id || !metadata.version || !metadata.name) {
output.write(`${collectionType} is missing one of the following required properties in its devcontainer-${collectionType}.json: 'id', 'version', 'name'.`, LogLevel.Error);
return;
}

Expand Down Expand Up @@ -212,8 +212,8 @@ export async function packageCollection(args: PackageCommandInput, collectionTyp
await tarDirectory(tmpSrcDir, archiveName, outputDir);

const metadata = jsonc.parse(await readLocalFile(jsonPath, 'utf-8'));
if (!metadata.id || !metadata.version) {
output.write(`${collectionType} '${c}' is missing an id or version in its ${devcontainerJsonName}`, LogLevel.Error);
if (!metadata.id || !metadata.version || !metadata.name) {
output.write(`${collectionType} '${c}' is missing one of the following required properties in its ${devcontainerJsonName}: 'id', 'version', 'name'.`, LogLevel.Error);
return;
}
metadatas.push(metadata);
Expand Down

0 comments on commit e3d12b3

Please sign in to comment.