Advertisement
Guest User

Untitled

a guest
Aug 16th, 2017
47
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.11 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. #
  4. # Create a Python3 virtualenv for Hieroglyph slide decks on Mac OS X.
  5. # Author: Shane MacBride @shanemacbride
  6. #
  7.  
  8. if !(test $1)
  9. then
  10. echo
  11. echo " Error: not enough arguments."
  12. echo " Usage: /slideDevelopment <nameOfVirtualEnvironment>"
  13. echo
  14. exit 1
  15. fi
  16.  
  17. if (test $2)
  18. then
  19. echo
  20. echo " Error: too many arguments."
  21. echo " Usage: /slideDevelopment <nameOfVirtualEnvironment>"
  22. echo
  23. exit 1
  24. fi
  25.  
  26. checkDependencies() {
  27. echo
  28. echo "Checking if $1 is installed..."
  29. which $1 > /dev/null
  30. if [ $? -eq 0 ]
  31. then
  32. echo "...true."
  33. echo
  34. else
  35. echo "...false."
  36. echo
  37. echo " Error: please install $1 to continue."
  38. echo
  39. exit 1
  40. fi
  41. }
  42.  
  43. echo
  44. echo "Checking dependencies..."
  45. checkDependencies "python3"
  46. checkDependencies "virtualenv"
  47.  
  48. echo "Creating $1..."
  49. virtualenv -p python3 $1
  50.  
  51. echo "Activating $1..."
  52. source $1/bin/activate
  53.  
  54. echo "Installing hieroglyph..."
  55. easy_install hieroglyph
  56.  
  57. echo "Installing correct dependencies..."
  58. pip install "docutils==0.12"
  59. pip install "sphinx==1.4.1"
  60.  
  61. echo "Running hieroglyph-quickstart..."
  62. hieroglyph-quickstart
  63.  
  64. echo "Building slides..."
  65. make slides
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement