Fix chdir problems, now that the config file cache is cleared.

This commit is contained in:
Colin Kuskie 2008-12-31 00:44:57 +00:00
parent 208ea281b7
commit a443999fc6

View file

@ -23,6 +23,7 @@ use Pod::Usage;
use WebGUI::Config;
use WebGUI::Session;
use WebGUI::Utility;
use Cwd;
my $help;
my $history;
@ -188,9 +189,11 @@ foreach my $file (@files) {
print "\nREADY TO BEGIN UPGRADES\n" unless ($quiet);
my $notRun = 1;
chdir($upgradesPath);
my $currentPath = getcwd();
foreach my $filename (keys %config) {
chdir($upgradesPath);
my $clicmd = $config{$filename}{mysqlCLI} || $mysql;
my $dumpcmd = $config{$filename}{mysqlDump} || $mysqldump;
my $backupTo = $config{$filename}{backupPath} || $backupDir;
@ -250,6 +253,7 @@ foreach my $filename (keys %config) {
$notRun = 0;
sleep 1; # Sleep a second to avoid adding asset revisions too quickly
}
chdir($currentPath);
my $session = WebGUI::Session->open($webguiRoot,$filename);
print "\tSetting site upgrade completed..." unless ($quiet);
$session->setting->remove('specialState');