-project.home value in build.properties file now generated automatically.
This commit is contained in:
parent
7613f189e0
commit
e2c4c53949
2 changed files with 12 additions and 10 deletions
|
@ -1,4 +1,6 @@
|
|||
project.home = /home/naomiaro/dev-campcaster/campcaster
|
||||
#Note: project.home is automatically generated by the propel-install script.
|
||||
#Any manual changes to this value will be overwritten.
|
||||
project.home = /path/to/airtime
|
||||
project.build = ${project.home}/build
|
||||
|
||||
#Database driver
|
||||
|
|
|
@ -31,19 +31,19 @@ if(exec("whoami") != "root"){
|
|||
|
||||
$property = 'project.home';
|
||||
$lines = file('../build/build.properties');
|
||||
foreach ($lines as $line) {
|
||||
foreach ($lines as $key => &$line) {
|
||||
if ($property == substr($line, 0, strlen($property))){
|
||||
$indexOfEquals = strpos($line, '=');
|
||||
if ($indexOfEquals !== false){
|
||||
$dir_value = trim(substr($line, $indexOfEquals+1));
|
||||
//check to make sure that the project.home path is equal to one level
|
||||
//up of this install script location.
|
||||
$dir_found = realpath(__dir__.'/../') == realpath($dir_value);
|
||||
}
|
||||
break;
|
||||
$line = $property." = ".realpath(__dir__.'/../')."\n";
|
||||
}
|
||||
}
|
||||
|
||||
$fp=fopen('../build/build.properties', 'w');
|
||||
foreach($lines as $key => $line){
|
||||
fwrite($fp, $line);
|
||||
}
|
||||
fclose($fp);
|
||||
|
||||
|
||||
if ($dir_found === false){
|
||||
echo ("../build/build.properties 'project.home' value of '$dir_value' is incorrect. Please correct and try install again.\n");
|
||||
exit(1);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue