Skip to content
This repository was archived by the owner on Apr 3, 2019. It is now read-only.

Commit b033726

Browse files
authored
Merge pull request #425 from mozilla/pb/fix-explain-script
#425 r=shane-tomlinson
2 parents b0dd33d + ff0ac5c commit b033726

File tree

1 file changed

+7
-3
lines changed

1 file changed

+7
-3
lines changed

scripts/explain-warn.js

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -301,11 +301,15 @@ function getProcedureNames () {
301301
}
302302

303303
function getPath (procedure) {
304-
return cp.execSync(
305-
`git grep "${procedure}" | grep 'CREATE PROCEDURE' | cut -d ':' -f 1 | sed '/^$/d'`,
304+
const path = cp.execSync(
305+
`git grep "${procedure}" | grep 'CREATE PROCEDURE' | sed '/^$/d'`,
306306
RETURN_STRING
307307
)
308-
.trim()
308+
.match(/(lib\/db\/schema\/patch-[0-9]+-[0-9]+\.sql)/)
309+
310+
if (path) {
311+
return path[1]
312+
}
309313
}
310314

311315
function extractSelects (path, procedure) {

0 commit comments

Comments
 (0)