Skip to content
This repository has been archived by the owner on Sep 18, 2024. It is now read-only.

Validate file name in codeDir for PAI platform #1168

Merged
merged 90 commits into from
Jun 21, 2019

Conversation

SparkSnail
Copy link
Contributor

@SparkSnail SparkSnail commented Jun 11, 2019

try {
fileCount = await countFilesRecursively(codeDir);
fileNameValid = await validateFileNameRecursively(codeDir);
} catch(error) {
throw new Error(`Call count file error: ${error}`);
Copy link
Contributor

Choose a reason for hiding this comment

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

this error message is not proper any more. Suggest to do countFile and validateFile one by one separately.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, validate filename and filecount separately.

try {
if (fs.lstatSync(fullFilePath).isFile()) {
result = validateFileName(fileName);
} else {
Copy link
Contributor

Choose a reason for hiding this comment

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

also need to validate directory's name?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed, validate directory name.

@SparkSnail SparkSnail merged commit e12df2b into microsoft:master Jun 21, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants