Skip to content

Commit

Permalink
Merge pull request #126 from connery-io/con-214
Browse files Browse the repository at this point in the history
fix: stop requesting maintainer info in CLI Init for the license
  • Loading branch information
machulav authored Aug 16, 2024
2 parents a8d6fce + facfc27 commit 0263085
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 37 deletions.
2 changes: 1 addition & 1 deletion packages/connery/src/cli/init/templates/LICENSE.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export default `MIT License
Copyright (c) {{year}} {{maintainer.name}} ({{maintainer.email}})
Copyright (c) {{year}}
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 0 additions & 4 deletions packages/connery/src/cli/init/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,5 @@ export type InitRepositoryParameters = {
name: string;
description: string;
};
maintainer: {
name: string;
email: string;
};
year: number;
};
32 changes: 0 additions & 32 deletions packages/connery/src/cli/init/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,45 +29,13 @@ export async function collectUserInput(): Promise<InitRepositoryParameters> {
return true;
},
}),
authorName: await input({
message: styleQuestion('What is the mainainer name?', '(for the license)'),
transformer: styleAnswer,
validate: (value: string) => {
if (value.trim() === '') {
return styleError('Please enter the maintainer name');
}
return true;
},
}),
authorEmail: await input({
message: styleQuestion('What is the maintainer email?', '(for the license)'),
transformer: styleAnswer,
validate: (value: string) => {
const emailRegex = /^[^\s@]+@[^\s@]+\.[^\s@]+$/;
const isValidEmail = emailRegex.test(value);

if (value.trim() === '') {
return styleError('Please enter the maintainer email');
}

if (!isValidEmail) {
return styleError('Please enter a valid email address');
}

return true;
},
}),
};

return {
plugin: {
name: answers.pluginName.trim(),
description: answers.pluginDescription.trim() || `Plugin built using Connery SDK.`,
},
maintainer: {
name: answers.authorName.trim(),
email: answers.authorEmail.trim(),
},
year: new Date().getFullYear(),
};
}
Expand Down

0 comments on commit 0263085

Please sign in to comment.