Skip to content
This repository was archived by the owner on Jul 19, 2020. It is now read-only.

Commit beeaf33

Browse files
committed
check package name length
1 parent 516e3b6 commit beeaf33

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

generators/app/index.js

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,13 @@ module.exports = class extends Generator {
4343
default: slugify(this.appname),
4444
store: true,
4545
validate: (str) => {
46-
return (str.startsWith('atom-') && this.allowAtomPrefix === false) ? 'Your package name shouldn\'t be prefixed with "atom-"' : true;
46+
if (str.startsWith('atom-') && this.allowAtomPrefix === false) {
47+
return 'Your package name shouldn\'t be prefixed with "atom-"';
48+
} else if (str.length > 241) {
49+
return 'The name must be less than or equal to 214 characters';
50+
}
51+
52+
return true;
4753
}
4854
},
4955
{

0 commit comments

Comments
 (0)