fi
}
+# tries to find an appropriate config file for the application.
+function locate_config_file()
+{
+ local app_dirname="$1"; shift
+
+ local configfile="$WORKDIR/config/${app_dirname}.app"
+echo hoping config file would be: $configfile
+ if [ ! -f "$configfile" ]; then
+ # this is not a good config file. we can't auto-guess the config.
+ echo -e "
+There is no specific site configuration file in:
+ $configfile
+We will continue onward using the default and hope that this project follows
+the standard pattern for cakephp projects."
+ # we'll pull in the default config file we set earlier; this will
+ # reinitialize some variables based on the app name.
+ else
+ # they gave us a valid config file. let's try using it.
+ export SITE_MANAGEMENT_CONFIG_FILE="$configfile"
+ fi
+
+ # try to load the config.
+ source "$SITE_MANAGEMENT_CONFIG_FILE"
+ test_or_die "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE"
+
+}
+
# this function will seek out top-level directories in the target directory passed in.
# if there is only one directory, then it is returned (in the app_dirname variable).
# otherwise, the user is asked which directory to use.
test_or_die "Testing application folder: $app_dirname"
echo "Application folder is: $app_dirname"
-
- local configfile="$WORKDIR/config/${app_dirname}.app"
-echo hoping config file would be: $configfile
- if [ ! -f "$configfile" ]; then
- # this is not a good config file. we can't auto-guess the config.
- echo -e "
-There is no specific site configuration file in:
- $configfile
-We will continue onward using the default and hope that this project follows
-the standard pattern for cakephp projects."
- # we'll pull in the default config file we set earlier; this will
- # reinitialize some variables based on the app name.
- else
- # they gave us a valid config file. let's try using it.
- export SITE_MANAGEMENT_CONFIG_FILE="$configfile"
- fi
-
- # try to load the config.
- source "$SITE_MANAGEMENT_CONFIG_FILE"
- test_or_die "loading site management configuration from: $SITE_MANAGEMENT_CONFIG_FILE"
}
# ensures that the app directory name is valid.
mkdir "$combo"
test_or_die "Making application directory when not already present"
fi
+
+ locate_config_file "$dir"
}
# eases some permissions to enable apache to write log files and do other shopkeeping.