Skip to content

Commit

Permalink
cli: allow any case extension name (#101)
Browse files Browse the repository at this point in the history
  • Loading branch information
technophile-04 authored Aug 24, 2024
1 parent 02d4758 commit c56aac4
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 2 deletions.
5 changes: 5 additions & 0 deletions .changeset/young-moose-move.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"create-eth": patch
---

cli: allow case-sensitive extension names
2 changes: 1 addition & 1 deletion src/utils/external-extensions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { SOLIDITY_FRAMEWORKS } from "./consts";
// Gets the data from the argument passed to the `--extension` option.
// e.g. owner/project:branch => { githubBranchUrl, githubUrl, branch, owner, project }
export const getDataFromExternalExtensionArgument = (externalExtension: string) => {
if (CURATED_EXTENSIONS[externalExtension]) {
if (CURATED_EXTENSIONS[externalExtension.toLowerCase()]) {
externalExtension = getArgumentFromExternalExtensionOption(CURATED_EXTENSIONS[externalExtension]);
}

Expand Down
4 changes: 3 additions & 1 deletion src/utils/parse-arguments-into-options.ts
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,10 @@ export async function parseArgumentsIntoOptions(

const project = args._[0] ?? null;

// use the original extension arg
const extensionName = args["--extension"] && rawArgs.slice(2).find(a => a.toLowerCase() === args["--extension"]);
// ToDo. Allow multiple
const extension = args["--extension"] ? await validateExternalExtension(args["--extension"], dev) : null;
const extension = extensionName ? await validateExternalExtension(extensionName, dev) : null;

if (!dev && extension && !CURATED_EXTENSIONS[args["--extension"] as string]) {
console.log(
Expand Down

0 comments on commit c56aac4

Please sign in to comment.