Last active
January 27, 2021 09:09
-
-
Save iegik/1268249 to your computer and use it in GitHub Desktop.
Create new CodeIgniter project
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# Creates new CodeIgniter project | |
if [ $1 ]; then | |
mkdir -p ./$1 | |
ln -s ~/public_html/codeigniter/system/ ./$1/system | |
cp -r ~/public_html/codeigniter/app/ ./$1/app | |
cp ~/public_html/codeigniter/index.php ./$1 | |
sed 's/RewriteBase \/~.*/RewriteBase \/~'`whoami`'\/'$1'/' ~/public_html/codeigniter/.htaccess > ./$1/.htaccess | |
sed 's/.base_url.*/"base_url"] = "http:\/\/'`hostname`'\/~'`whoami`'\/'$1'\/";/' ./codeigniter/app/config/config.php > ./$1/app/config/config.php | |
echo "You can see Your page on \"http://`hostname`/~`whoami`/$1\"" | |
else | |
echo "usage: $ci [project name]" | |
fi |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment