Skip to content

Commit d6fa325

Browse files
authored
Merge pull request #8452 from ProcessMaker/bugfix/FOUR-25792
bugfix/FOUR-25792 added a rsync to create the lang folders when creating a new tenant
2 parents 9760a2f + eb0eb08 commit d6fa325

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

ProcessMaker/Console/Commands/TenantsCreate.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -106,6 +106,7 @@ public function handle()
106106

107107
// Check if an existing lang folder is provided
108108
$langFolderOption = $this->option('lang-folder', null);
109+
$sourceLangPath = resource_path('lang');
109110
$tenantLangPath = resource_path('lang/tenant_' . $tenant->id);
110111
if ($langFolderOption) {
111112
if (File::isDirectory($langFolderOption)) {
@@ -129,6 +130,18 @@ public function handle()
129130
}
130131
}
131132

133+
$cmd = sprintf(
134+
"rsync -azv --ignore-existing --exclude='tenant_*' %s %s",
135+
escapeshellarg($sourceLangPath . '/'),
136+
escapeshellarg($tenantLangPath)
137+
);
138+
exec($cmd, $output, $returnVar);
139+
if ($returnVar !== 0) {
140+
$this->error('Failed to rsync lang folder to tenant: ' . implode(PHP_EOL, $output));
141+
142+
return 1;
143+
}
144+
132145
$subfolders = [
133146
'app',
134147
'app/private',

0 commit comments

Comments
 (0)