Skip to content
GitLab
Projects
Groups
Snippets
Help
Loading...
Help
What's new
10
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Open sidebar
libre
fonts-degooglifier
Commits
60a7525c
Commit
60a7525c
authored
Jan 26, 2019
by
Michał 'rysiek' Woźniak
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
for compatibility reasons, use `sed`'s `-E` flag instead of `-r` (fixes
#6
)
parent
7a3ea0f5
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
4 additions
and
4 deletions
+4
-4
degooglify.sh
degooglify.sh
+4
-4
No files found.
degooglify.sh
View file @
60a7525c
...
...
@@ -50,7 +50,7 @@ function curlwget {
#
# $1 -- URL to handle
function
get_local_filename_from_url
()
{
echo
-n
"
$1
"
|
sed
-
r
-e
's%https://fonts.googleapis.com/css\?family=%%'
-e
's/&(amp;)?/__/'
|
tr
'|:+,='
'_-'
echo
-n
"
$1
"
|
sed
-
E
-e
's%https://fonts.googleapis.com/css\?family=%%'
-e
's/&(amp;)?/__/'
|
tr
'|:+,='
'_-'
echo
'.css'
}
...
...
@@ -110,7 +110,7 @@ function degooglify_css_file_import() {
# get the URL
# this sed expression will get the *last* occurence of the 'url()' stanza
local
CSS_IMPORT_URL
=
"
$(
echo
"
$CSS_IMPORT_LINE
"
|
sed
-
r
-e
"s/.*url
\(
'?([^')]+)'?
\)
.*/
\1
/g"
)
"
local
CSS_IMPORT_URL
=
"
$(
echo
"
$CSS_IMPORT_LINE
"
|
sed
-
E
-e
"s/.*url
\(
'?([^')]+)'?
\)
.*/
\1
/g"
)
"
echo
" +-- CSS remote URL:
$CSS_IMPORT_URL
"
# get the local filename
...
...
@@ -189,7 +189,7 @@ function degooglify_css_file_src() {
# get the URL
# this sed expression will get the *last* occurence of the 'url()' stanza
local
FONT_URL
=
"
$(
echo
"
$FONT_SRC_LINE
"
|
sed
-
r
-e
"s/.*url
\(
'?([^')]+)'?
\)
.*/
\1
/g"
)
"
local
FONT_URL
=
"
$(
echo
"
$FONT_SRC_LINE
"
|
sed
-
E
-e
"s/.*url
\(
'?([^')]+)'?
\)
.*/
\1
/g"
)
"
echo
" +-- URL:
$FONT_URL
"
# check if the URL is a fonts.gstatic.com one
...
...
@@ -204,7 +204,7 @@ function degooglify_css_file_src() {
# get the local name
# this sed expression will get the *last* occurence of the 'local()' stanza
# tr removes spaces just in case
local
FONT_NAME
=
"
$(
echo
"
$FONT_SRC_LINE
"
|
sed
-
r
-e
"s/.*local
\(
'?([^')]+)'?
\)
.*/
\1
/g"
|
tr
-d
' '
)
"
local
FONT_NAME
=
"
$(
echo
"
$FONT_SRC_LINE
"
|
sed
-
E
-e
"s/.*local
\(
'?([^')]+)'?
\)
.*/
\1
/g"
|
tr
-d
' '
)
"
# download the font
local
FONT_FILE
=
"
$FONT_DIR
/
$FONT_NAME
.
$FONT_EXT
"
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment