Advertisement
metalx1000

Phaser Template Retriever

Jun 4th, 2017
559
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.71 KB | None | 0 0
  1. #!/bin/bash
  2.  
  3. if [ $# -lt 1 ]
  4. then
  5.   echo "Project name needed"
  6.   echo "Usage: $0 <project name>"
  7.   echo "Example: $0 'MyGame'"
  8.   exit 1
  9. fi
  10.  
  11. url="https://github.com/metalx1000/Phaser-Minimal-Setup/archive/master.zip"
  12. zip="/tmp/phaser.zip"
  13. dir="Phaser-Minimal-Setup-master"
  14.  
  15. if [ -d "$dir" ];
  16. then
  17.   echo "$dir already exists."
  18.   echo "Goodbye..."
  19.   exit 1
  20. fi
  21.  
  22. if [ -d "$1" ];
  23. then
  24.   echo "Project $1 already exists."
  25.   echo "Goodbye..."
  26.   exit 1
  27. fi
  28.  
  29. echo "Downloading template..."
  30. wget "$url" -O "$zip"||exit 1
  31. echo "Unzipping..."
  32. unzip "$zip"
  33. echo "Removing TMP files..."
  34. rm "$zip"
  35. echo "Renaming project folder to $1"
  36. mv "$dir" "$1"
  37.  
  38. echo ""
  39. echo ""
  40. echo "You're project is in $1"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement