Page Menu
Home
WickedGov Phorge
Search
Configure Global Search
Log In
Files
F5962848
getattributecheck.sh
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Flag For Later
Award Token
Size
739 B
Referenced Files
None
Subscribers
None
getattributecheck.sh
View Options
#!/bin/bash
# Ensure that no more uses of $node -> getAttribute creep into our repository...
# we should be using DOMCompat::getAttribute( $node )
BIN
=
$(
dirname
$0
)
# put this string together in a somewhat awkward way so that it doesn't
# trigger a match itself.
grepPhrase
=
"getAttribute"
badWords
=
'$node->'
"
$grepPhrase
"
'('
grepPhrase
=
"[-]>
$grepPhrase
[(]"
# If any of these commands fail, something is wrong!
set
-ev
# exclude DOMCompat
FILES
=
$(
git
grep
-l
'[-]>'
)
# Ensure exactly 1 line is present (in DOMCompat::getAttribute itself)
x
=
`
git
grep
"
$grepPhrase
"
$FILES
|
wc
-l
`
if
[
!
$x
-eq
1
]
then
echo
"Uses of
$badWords
found! :("
git
grep
-P
"
$grepPhrase
"
$FILES
exit
-1
fi
echo
"No new uses of
$badWords
found! :)"
File Metadata
Details
Attached
Mime Type
text/x-shellscript
Expires
Sat, Oct 3, 09:12 (1 w, 3 d ago)
Storage Engine
local-disk
Storage Format
Raw Data
Storage Handle
4f/6c/8337005794a09e8f3d1eafe047aa
Default Alt Text
getattributecheck.sh (739 B)
Attached To
Mode
rMWPROD MediaWiki Production
Attached
Detach File
Event Timeline
Log In to Comment