![]() |
Generate very basic CI project from the command line - Printable Version +- CodeIgniter Forums (https://forum.codeigniter.com) +-- Forum: Archived Discussions (https://forum.codeigniter.com/forumdisplay.php?fid=20) +--- Forum: Archived Libraries & Helpers (https://forum.codeigniter.com/forumdisplay.php?fid=22) +--- Thread: Generate very basic CI project from the command line (/showthread.php?tid=21786) |
Generate very basic CI project from the command line - El Forum - 08-20-2009 [eluser]AzizLight[/eluser] Hi everybody, I just started using CI and I wanted to have a way of generating a very basic CI project from the command line. What I mean by that is a lot simpler and minimalistic than it sounds: a fresh unzipped CI folder is copied to the current folder, renamed and then the user is given the choice to move the application folder outside the system folder. I created a very simple bash script that does exactly that. Before you continue reading, please be warned that I litteraly learned bash programming while writting this script so the code is definitely rudimentary and perfectible. Aditonally, the code is quite poorly documented, I'm sorry about that. However it's enough for me. I only tested this script in OS X 10.5 but I'm pretty sure it will work perfectly in any Unix-based/Linux Distribution that has bash installed and probably under Windows with Cygwin Code: #!/bin/bash To use this script, copy the code in a blank file, name it ci (or whatever you want). Replace the path in line 3 with the path of the CI folder in you computer, the one that will be copied to the new location to create your new project, and make it exectable: Code: chmod a+x ci then move the file to the folder of you choice and add that folder to the $PATH. I chose the ~/bin/ folder for the exemple: Code: mv ci ~/bin Code: export PATH=/Users/aziz/bin:$PATH Code: export PATH=/opt/local/bin:/opt/local/sbin:/opt/subversion:/Users/aziz/bin:$PATH I release this code to the public domain, do whatever you want with it ![]() ![]() Enjoy! |