Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fixes issue where project name could have a / in it #166

Merged
merged 1 commit into from
Jan 21, 2018
Merged
Show file tree
Hide file tree
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
3 changes: 1 addition & 2 deletions src/utils/project-configuration-validator.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,8 @@ export function validateProjectName(value) {
// a project name is a project name for which the folder does not exist,
// for which the name is no blank/undefined or contains spaces

// TODO: this validation allows for project names with /, which would not create a valid directory
if (typeof value === 'undefined' || value === ''
|| value.indexOf(' ') !== -1 || !isValidPath(value)) {
|| value.indexOf(' ') !== -1 || !isValidPath(value) || value.indexOf('/') > -1) {
return 'Invalid project name!';
}

Expand Down
3 changes: 1 addition & 2 deletions test/project-configuration-validator.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -118,8 +118,7 @@ describe('Project Configuration Validator', () => {
assert.equal(validateProjectName('**baddname'), 'Invalid project name!');
assert.equal(validateProjectName(), 'Invalid project name!');
assert.equal(validateProjectName('thisisaverylongnamethatisovertwentycharacterslong'), 'Project Names must be less than 20 characters or less!');
//TODO add validation for / when it gets fixed
//assert.equal(validateProjectName("jack/"), 'Invalid project name!')
assert.equal(validateProjectName("test1/"), 'Invalid project name!')
});

});
Expand Down