|
@@ -91,6 +91,7 @@ function get_string_from_stdin($noecho=0) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function install( $to, $from, $files2copy ) {
|
|
function install( $to, $from, $files2copy ) {
|
|
|
|
|
+ if( empty($to), empty($from) || empty($files2copy) ) die("Bad arguments passed to 'install' function");
|
|
|
if( file_exists( $to ) && !is_dir( $to ) ) {
|
|
if( file_exists( $to ) && !is_dir( $to ) ) {
|
|
|
echo "[FATAL] $to already exists but is not a directory! Stopping here.\n";
|
|
echo "[FATAL] $to already exists but is not a directory! Stopping here.\n";
|
|
|
exit(1);
|
|
exit(1);
|
|
@@ -108,6 +109,7 @@ function install( $to, $from, $files2copy ) {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
function ensure_directories_exist( $dirs ) {
|
|
function ensure_directories_exist( $dirs ) {
|
|
|
|
|
+ if( empty( $dirs ) ) die("Bad arguments passed to 'ensure_directories_exist' function");
|
|
|
foreach ( $dirs as $dir ) {
|
|
foreach ( $dirs as $dir ) {
|
|
|
if ( !file_exists( $dir ) ) {
|
|
if ( !file_exists( $dir ) ) {
|
|
|
echo "exec `/bin/mkdir '$dir'`\n";
|
|
echo "exec `/bin/mkdir '$dir'`\n";
|