Skip to content

Commit 8ad025b

Browse files
authored
Validate filename length (#20)
1 parent 769c44f commit 8ad025b

File tree

3 files changed

+12
-9
lines changed

3 files changed

+12
-9
lines changed

package-lock.json

Lines changed: 8 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "podil",
3-
"version": "0.3.2",
3+
"version": "0.3.3",
44
"description": "Lightweight and secure database migration tool",
55
"main": "dist/cjs/index.js",
66
"module": "dist/esm/index.js",

src/Podil.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,9 @@ export class Podil {
2424
`File '${file}' cannot be executed. Make sure the directory with migrations contains only '.sql' files.`
2525
)
2626
}
27+
if (file.length > 255) {
28+
throw new Error(`Script filename exceeds the allowed 255 symbols limit: ${file}`)
29+
}
2730
}
2831
const fsScripts = files.sort((a, b) => a.localeCompare(b))
2932
if (fsScripts.length < appliedScripts.length) {

0 commit comments

Comments
 (0)