Add new and clean commands.
This commit is contained in:
parent
17e14672ff
commit
cbb6f3d8a3
30
isidore.sh
30
isidore.sh
@ -70,8 +70,13 @@ function set_config_vars()
|
||||
source $ISIDORE_CONFIG_DIR/config
|
||||
}
|
||||
|
||||
function print_usage()
|
||||
{
|
||||
echo "USAGE: $1 <command> [options]"
|
||||
}
|
||||
|
||||
##
|
||||
# Create a new project
|
||||
# Create a new project.
|
||||
#
|
||||
# Params:
|
||||
# $1 - The project directory
|
||||
@ -84,10 +89,31 @@ function new_project()
|
||||
mkdir $NEW_PROJECT_DIR
|
||||
mkdir -p $NEW_PROJECT_DIR/site/
|
||||
mkdir -p $NEW_PROJECT_DIR/templates/
|
||||
echo "<?php
|
||||
echo \
|
||||
"<?php
|
||||
\$site_name = \"$NEW_PROJECT_NAME\";
|
||||
\$author = \"$ISIDORE_AUTHOR_NAME\";
|
||||
?>" >> $NEW_PROJECT_DIR/config.php
|
||||
}
|
||||
|
||||
##
|
||||
# Clean a project's build.
|
||||
##
|
||||
function clean_project()
|
||||
{
|
||||
# TODO: Ensure that this is within an Isidore project.
|
||||
rm -r output/
|
||||
echo "Project cleaned."
|
||||
}
|
||||
|
||||
set_config_vars
|
||||
|
||||
case $1 in
|
||||
new)
|
||||
new_project $2 $3;;
|
||||
clean)
|
||||
clean_project;;
|
||||
*)
|
||||
echo "Unknown command $1. Use the 'help' command."
|
||||
print_usage $0;;
|
||||
esac
|
||||
|
Loading…
Reference in New Issue
Block a user