Guest User

Untitled

a guest
Feb 19th, 2018
68
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.61 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #Usage
  4. #Place this scprit in the wiki folder and run the following using your github :
  5. #bash bake_wiki.sh USER PASS
  6.  
  7. for fullfile in *; do
  8. filename=$(basename "$fullfile")
  9. filename="${filename%.*}"
  10. echo $filename
  11. grip "$filename.md" --export export/"$filename.html" --user=$1 --pass=$2
  12.  
  13. for fullfile2 in *; do
  14. filename2=$(basename "$fullfile2")
  15. filename2="${filename2%.*}"
  16.  
  17. find="-"
  18. replace=" "
  19. filename_with_spaces=${filename2//$find/$replace}
  20.  
  21. sed -i -e "s/\[\[$filename_with_spaces]]/<a href='$filename2.html'>$filename_with_spaces<\/a>/g" export/"$filename.html"
  22. done
  23. done
Add Comment
Please, Sign In to add comment