pull/15494/head
Carl Mastrangelo 7 years ago
parent a613f2f537
commit a5433ddcfb
  1. 13
      tools/api_reference/add_google_analytics.sh

@ -1,4 +1,4 @@
#!/bin/sh #!/bin/bash
# Copyright 2018 The gRPC Authors # Copyright 2018 The gRPC Authors
# #
# Licensed under the Apache License, Version 2.0 (the "License"); # Licensed under the Apache License, Version 2.0 (the "License");
@ -28,12 +28,13 @@ read -r -d '' SNIPPET << EOF
</script> </script>
EOF EOF
S="$(echo -n $SNIPPET | tr '\n' ' ')" S=$(echo -n "$SNIPPET" | tr '\n' ' ')
for M in $(find -name \*.html); while IFS= read -r -d '' M
do do
grep -q "i,s,o,g,r,a,m" "$M" if grep -q "i,s,o,g,r,a,m" "$M"; then
if [[ $? -ne 0 ]]; then :
else
sed -i "s_</head>_${S}</head>_" "$M" sed -i "s_</head>_${S}</head>_" "$M"
fi fi
done; done < <(find . -name \*.html -print0)

Loading…
Cancel
Save