-
Notifications
You must be signed in to change notification settings - Fork 119
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2099 from xodio/fix-2097-do-not-load-invalid-patc…
…h-paths Do not load project with invalid patch paths
- Loading branch information
Showing
6 changed files
with
71 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,21 @@ | ||
import * as R from 'ramda'; | ||
import { PROJECT_LOADED_WITH_INVALID_PATCH_PATHS } from './errorCodes'; | ||
|
||
const formatPatchPaths = R.compose( | ||
R.join(', '), | ||
R.when( | ||
patchPaths => patchPaths.length > 3, | ||
R.compose(R.append('…'), R.take(3)) | ||
) | ||
); | ||
|
||
export default { | ||
[PROJECT_LOADED_WITH_INVALID_PATCH_PATHS]: ({ patchPaths }) => ({ | ||
title: 'Cannot load some patches', | ||
note: `Some patches have an invalid patch paths: ${formatPatchPaths( | ||
patchPaths | ||
)}`, | ||
solution: | ||
'Open the "__lib__" directory in your workspace and ensure that listed directory names are valid. Only lowercase latin alphabet, numbers, and hypens are allowed.', | ||
}), | ||
}; |