Skip to content

Commit 53f354c

Browse files
author
Christian Blanquera
committed
mkdir and chmod
1 parent 0ddcc49 commit 53f354c

1 file changed

Lines changed: 46 additions & 2 deletions

File tree

src/events/install.php

Lines changed: 46 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -125,6 +125,52 @@
125125
}
126126
}
127127

128+
//create compiled, log, public/upload, config/schema
129+
if(!$request->hasStage('skip-mkdir')) {
130+
if (!is_dir($cwd . '/compiled')) {
131+
CommandLine::system('Making ' . $cwd . '/compiled');
132+
mkdir($cwd . '/compiled', 0777);
133+
}
134+
135+
if (!is_dir($cwd . '/log')) {
136+
CommandLine::system('Making ' . $cwd . '/log');
137+
mkdir($cwd . '/log', 0777);
138+
}
139+
140+
if (!is_dir($cwd . '/public/upload')) {
141+
CommandLine::system('Making ' . $cwd . '/public/upload');
142+
mkdir($cwd . '/public/upload', 0777);
143+
}
144+
145+
if (!is_dir($cwd . '/config/schema')) {
146+
CommandLine::system('Making ' . $cwd . '/config/schema');
147+
mkdir($cwd . '/config/schema', 0777);
148+
}
149+
}
150+
151+
//chmod compiled, log, config, public/upload
152+
if(!$request->hasStage('skip-chmod')) {
153+
if (is_dir($cwd . '/compiled')) {
154+
CommandLine::system('chmoding ' . $cwd . '/compiled');
155+
chmod($cwd . '/compiled', 0777);
156+
}
157+
158+
if (is_dir($cwd . '/log')) {
159+
CommandLine::system('chmoding ' . $cwd . '/log');
160+
chmod($cwd . '/log', 0777);
161+
}
162+
163+
if (is_dir($cwd . '/config')) {
164+
CommandLine::system('chmoding ' . $cwd . '/config');
165+
chmod($cwd . '/config', 0777);
166+
}
167+
168+
if (is_dir($cwd . '/public/upload')) {
169+
CommandLine::system('chmoding ' . $cwd . '/public/upload');
170+
chmod($cwd . '/public/upload', 0777);
171+
}
172+
}
173+
128174
if(!$request->hasStage('skip-sql')) {
129175
//SQL
130176
CommandLine::system('Setting up SQL...');
@@ -189,6 +235,4 @@
189235
CommandLine::info('Recommended actions:');
190236
CommandLine::info(' - bin/cradle sql populate');
191237
CommandLine::info(' - yarn build');
192-
CommandLine::info(' - chmod -R 777 config/admin');
193-
CommandLine::info(' - chmod -R 777 config/i18n');
194238
};

0 commit comments

Comments
 (0)