Last Updated: February 25, 2016
· pluckee

CLI based project structure generator

I'll admit, im really lazy when it comes to development and making files/directories (so you can see why i love rails) but i was recently given a job where it was just a basic HTML/PHP site so no need for rails (sad face) but i didnt want to to make every file one at a time, so i turned to my favourite tool ever the CLI and bash scripting so i wrote a small script which generates a pre populated boilerplate for site development, just run the script and go, it uses HTML5 boilerplate for the index page, and bootstrap CSS and JS libraries aswell as jquery

cd ~/Desktop/Projects #<--Change This to your own projects directory

mkdir myProject && cd myProject #<--Change myProject to your project name

echo "Generating Assets Pipeline"

mkdir assets
mkdir assets/css
mkdir assets/js
mkdir assets/images

echo "Generating Index File"
wget -O index.html

echo "Downloading latest version of bootstrap to assets pipe"
wget -O assets/css/bootstrap-responsive.css
wget -O assets/css/bootstrap.css
wget -O assets/js/bootstrap.min.js

echo "Downloading jQuery to assets pipe"
wget -O assets/js/jquery.min.js

3 Responses
Add your response

nice script. the wonders of CLI tools and bash. anything to make a project that much more standardized & automated!

over 1 year ago ·

Doing that at a wider/higher level would be using Yeoman.
It's basically a piece of software that bootstraps your web application, with a lot more, dependencies resolving, testing and... lots of things to read...

over 1 year ago ·

@mrgamer sometimes testing and all that jazz just isn't required like granted if you are building a more complex application, but simple sites and projects just the essentials are nice

over 1 year ago ·

Have a fresh tip? Share with Coderwall community!

Post a tip