Script to install library dependencies for project
puzzud opened this issue · 2 comments
The project currently depends on a third party library called Phaser.
Also, some provisions allow for the optional use of a 3D graphics library called Three.
Although many actual game projects maintain and revision a checkout of a full or minified version of Phaser or Three, this project does not.
A script could be written to speed up the download or checkout of these third parties; as well as placing them in the appropriate locations for the game template to run.
The script should be called libsetup.sh or libsetup.py.
The script should take a hypothetical unlimited number of parameters. For now, it should acknowledge the following:
- three
The script should ensure that it can download files from some set URLs. If it cannot (eg unavailability of wget), it should return with a error and message.
The script should download the following files:
- https://raw.githubusercontent.com/photonstorm/phaser/master/build/phaser.js
- https://raw.githubusercontent.com/photonstorm/phaser/master/build/phaser.map.js
- https://raw.githubusercontent.com/photonstorm/phaser/master/build/phaser.min.js
If the "three" parameter is specified, the script should download the following files:
- https://raw.githubusercontent.com/mrdoob/three.js/master/build/three.js
- https://raw.githubusercontent.com/mrdoob/three.js/master/build/three.min.js
The script should create the following subdirectories (if they don't already exist) in the project directory (for three, only create if "three" parameter supplied):
- src/phaser
- src/three
The downloaded phaser files should populate the phaser directory.
The downloaded three files should populate the three directory.
If any downloaded files are replacing existing files in their respective directories, it should replace such files.
Added libsetup.py to tools.
Added a parameter called "replace".
When specified, any existing files it finds, it will replace rather than avoiding its replacement (default).