Skip to content

Commit eb0eb08

Browse files
added a rsync to create the lang folders when creating a new tenant
1 parent 495ac82 commit eb0eb08

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
@@ -108,6 +108,7 @@ public function handle()
108108

109109
// Check if an existing lang folder is provided
110110
$langFolderOption = $this->option('lang-folder', null);
111+
$sourceLangPath = resource_path('lang');
111112
$tenantLangPath = resource_path('lang/tenant_' . $tenant->id);
112113
if ($langFolderOption) {
113114
if (File::isDirectory($langFolderOption)) {
@@ -131,6 +132,18 @@ public function handle()
131132
}
132133
}
133134

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

0 commit comments

Comments
 (0)