Skip to content
Snippets Groups Projects
Commit 624506a9 authored by Demian Katz's avatar Demian Katz
Browse files

Resolved bug in install script: directory structure not correctly initialized...

Resolved bug in install script: directory structure not correctly initialized when choosing default local directory in interactive mode.  (Resolves VUFIND-697).
parent bf1dc48e
No related merge requests found
...@@ -53,9 +53,7 @@ if (!isset($argv[1]) || !in_array('--use-defaults', $argv)) { ...@@ -53,9 +53,7 @@ if (!isset($argv[1]) || !in_array('--use-defaults', $argv)) {
} else { } else {
// In interactive mode, we initialize the directory as part of the input // In interactive mode, we initialize the directory as part of the input
// process; in defaults mode, we need to do it here: // process; in defaults mode, we need to do it here:
if (!initializeOverrideDir($overrideDir)) { initializeOverrideDir($overrideDir, true);
die("Cannot initialize local override directory: {$overrideDir}\n");
}
} }
// Build the Windows start file in case we need it: // Build the Windows start file in case we need it:
...@@ -131,11 +129,12 @@ function getBasePath($basePath) ...@@ -131,11 +129,12 @@ function getBasePath($basePath)
/** /**
* Initialize the override directory and report success or failure. * Initialize the override directory and report success or failure.
* *
* @param string $dir Path to attempt to initialize * @param string $dir Path to attempt to initialize
* @param bool $dieOnError Should we die outright if we fail?
* *
* @return void * @return void
*/ */
function initializeOverrideDir($dir) function initializeOverrideDir($dir, $dieOnError = false)
{ {
$dirStatus = buildDirs( $dirStatus = buildDirs(
array( array(
...@@ -146,6 +145,9 @@ function initializeOverrideDir($dir) ...@@ -146,6 +145,9 @@ function initializeOverrideDir($dir)
$dir . '/import' $dir . '/import'
) )
); );
if ($dieOnError && ($dirStatus !== true)) {
die("Cannot initialize local override directory: {$dir}\n");
}
return $dirStatus === true; return $dirStatus === true;
} }
...@@ -170,6 +172,7 @@ function getOverrideDir($overrideDir) ...@@ -170,6 +172,7 @@ function getOverrideDir($overrideDir)
return str_replace('\\', '/', realpath($overrideDirInput)); return str_replace('\\', '/', realpath($overrideDirInput));
} }
} else { } else {
initializeOverrideDir($overrideDir, true);
return $overrideDir; return $overrideDir;
} }
} }
......
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment