More thorough regex for internal UUID finder
This commit is contained in:
parent
d5993cde6f
commit
3251959e4e
|
@ -25,7 +25,7 @@ declare -A styled=( ["brief@mozdev.org"]="brief"
|
|||
["vim-vixen@i-beam.org"]="vim_vixen"
|
||||
)
|
||||
|
||||
line=$(sed -n -e '/^user_pref("extensions.webextensions.uuids"/p' ../prefs.js)
|
||||
line=$(sed -n -e 's/^user_pref("extensions.webextensions.uuids", "{\(.*\).*}");/\1/p' "$profile/prefs.js")
|
||||
|
||||
## Remove prefix and suffix
|
||||
prefix='user_pref("extensions.webextensions.uuids", "{'
|
||||
|
@ -37,12 +37,8 @@ suffix='\\"'
|
|||
|
||||
IFS=',' read -ra EXTS <<< "$line"
|
||||
for i in "${EXTS[@]}"; do
|
||||
id=${i%:*}
|
||||
uuid=${i#*:}
|
||||
id=${id#$prefix}
|
||||
id=${id%$suffix}
|
||||
uuid=${uuid#$prefix}
|
||||
uuid=${uuid%$suffix}
|
||||
id=$(echo $i | sed -n 's/.*"\(.*\)\\":.*/\1/p')
|
||||
uuid=$(echo $i | sed -n 's/.*"\(.*\)\\".*/\1/p')
|
||||
if test "${styled[$id]+isset}"
|
||||
then
|
||||
echo "${styled[$id]}_UUID=$uuid" >> 'ShadowFox_customization/internal_UUIDs.txt'
|
||||
|
|
Loading…
Reference in New Issue