Skip to content

Commit

Permalink
Validate filename length (#20)
Browse files Browse the repository at this point in the history
  • Loading branch information
Shpota authored Jan 10, 2023
1 parent 769c44f commit 8ad025b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 9 deletions.
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "podil",
"version": "0.3.2",
"version": "0.3.3",
"description": "Lightweight and secure database migration tool",
"main": "dist/cjs/index.js",
"module": "dist/esm/index.js",
Expand Down
3 changes: 3 additions & 0 deletions src/Podil.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,9 @@ export class Podil {
`File '${file}' cannot be executed. Make sure the directory with migrations contains only '.sql' files.`
)
}
if (file.length > 255) {
throw new Error(`Script filename exceeds the allowed 255 symbols limit: ${file}`)
}
}
const fsScripts = files.sort((a, b) => a.localeCompare(b))
if (fsScripts.length < appliedScripts.length) {
Expand Down

0 comments on commit 8ad025b

Please sign in to comment.