Guest User

Untitled

a guest
Dec 9th, 2018
85
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.23 KB | None | 0 0
  1. #!/usr/bin/env bash
  2.  
  3. # Get the path to the icons folder or sets a default path
  4. if [ -n "$1" ]
  5. then
  6. aesIconsPath=$1
  7. else
  8. aesIconsPath="${HOME}/Downloads/aes-icons/"
  9. echo "Source path set to ${aesIconsPath}"
  10. fi
  11.  
  12. # Copy scss and fonts to their correct location
  13. echo "Copying files from icomoon source folder..."
  14. cp "${aesIconsPath}variables.scss" "./app/assets/scss/variables/_icons.scss"
  15. cp "${aesIconsPath}style.scss" "./app/assets/scss/styleguide/_icons.scss"
  16. cp -R "${aesIconsPath}fonts/." "./app/assets/fonts"
  17.  
  18. # Patterns to fix the scss relative paths to fonts
  19. fontPathPattern="fonts"
  20. newFontPathPattern="\.\.\/fonts"
  21.  
  22. # Patterns to switch eot font import to base64 encoded eot
  23. iefixPattern="#{\$icomoon-font-path}\/#{\$icomoon-font-family}\.eot?.*\#iefix"
  24. b64IefixPattern="data:font\/eot;base64,"$(base64 ./app/assets/fonts/aes-icons.eot | sed "s,\/,\\\/,g" | tr -d "[:space:]")
  25.  
  26. # Replace patterns in scss files
  27. echo "Making changes in scss files..."
  28. sed -i "s/"$fontPathPattern"/"$newFontPathPattern"/g" ./app/assets/scss/variables/_icons.scss
  29. sed -i "s/"$iefixPattern"/"$b64IefixPattern"/" ./app/assets/scss/styleguide/_icons.scss
  30. sed -i "s/@import \"variables\";/ /" ./app/assets/scss/styleguide/_icons.scss
  31.  
  32. echo "Aes icons change done."
Add Comment
Please, Sign In to add comment