Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions eng/tools/TypeSpecValidation/src/TypeSpecValidation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,17 @@ export async function main() {
const folder = parsedArgs.positionals[0];
console.log("Running TypeSpecValidation on folder:", folder);

// Verify specs' path requirements
let leafDir = folder.substring(folder.lastIndexOf(path.sep) + 1);
if (leafDir.includes(".") && !/\w\.[A-Z]/.test(leafDir)) {
throw new Error(
"Please rename the folder " +
leafDir +
" to " +
leafDir.replace(/\.\w/g, (l) => l.toUpperCase())
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Won't this also cause any other of the same letters to be upper cased in the path?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@weshaggard: I converted this PR back to draft. It will have significant changes before merging.

);
}

// Verify all specs are using root level pacakge.json
let expected_npm_prefix = process.cwd();
const actual_npm_prefix = (await runCmd(`npm prefix`, folder)).trim();
Expand Down