Skip to content

Commit f7f3eaa

Browse files
committed
dont execute any process if theme not found
1 parent d99be9b commit f7f3eaa

File tree

2 files changed

+58
-55
lines changed

2 files changed

+58
-55
lines changed

.idea/workspace.xml

Lines changed: 12 additions & 13 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/Command/MultiAuthPrepare.php

Lines changed: 46 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -77,67 +77,71 @@ public function handle()
7777
$admin_theme = 'adminlte';
7878
}
7979

80-
if ($this->isAlreadySetup() == false) {
80+
if (file_exists(__DIR__ . '/../Backpack/Views/'.$theme_name)) {
81+
if ($this->isAlreadySetup() == false) {
8182

82-
$this->line(" installing migrations...");
83-
$this->installMigration();
84-
$this->progressBar->advance();
83+
$this->line(" installing migrations...");
84+
$this->installMigration();
85+
$this->progressBar->advance();
8586

86-
$this->line(" installing models...");
87-
$this->installModel();
88-
$this->progressBar->advance();
87+
$this->line(" installing models...");
88+
$this->installModel();
89+
$this->progressBar->advance();
8990

90-
$this->line(" installing route maps...");
91-
$this->installRouteMaps();
92-
$this->progressBar->advance();
91+
$this->line(" installing route maps...");
92+
$this->installRouteMaps();
93+
$this->progressBar->advance();
9394

94-
$this->line(" installing route files...");
95-
$this->installRouteFiles();
96-
$this->progressBar->advance();
95+
$this->line(" installing route files...");
96+
$this->installRouteFiles();
97+
$this->progressBar->advance();
9798

98-
$this->line(" installing controllers...");
99-
$this->installControllers();
100-
$this->progressBar->advance();
99+
$this->line(" installing controllers...");
100+
$this->installControllers();
101+
$this->progressBar->advance();
101102

102-
$this->line(" installing requests...");
103-
$this->installRequests();
104-
$this->progressBar->advance();
103+
$this->line(" installing requests...");
104+
$this->installRequests();
105+
$this->progressBar->advance();
105106

106-
$this->line(" installing configs...");
107-
$this->installConfigs();
108-
$this->progressBar->advance();
107+
$this->line(" installing configs...");
108+
$this->installConfigs();
109+
$this->progressBar->advance();
109110

110-
$this->line(" installing middleware...");
111-
$this->installMiddleware();
112-
$this->progressBar->advance();
111+
$this->line(" installing middleware...");
112+
$this->installMiddleware();
113+
$this->progressBar->advance();
113114

114-
$this->line(" installing unauthenticated function...");
115-
$this->installUnauthenticated();
116-
$this->progressBar->advance();
115+
$this->line(" installing unauthenticated function...");
116+
$this->installUnauthenticated();
117+
$this->progressBar->advance();
117118

118-
$this->line(" installing views...");
119-
$this->installView($admin_theme);
120-
$this->progressBar->advance();
119+
$this->line(" installing views...");
120+
$this->installView($admin_theme);
121+
$this->progressBar->advance();
121122

122-
$this->line(" installing prologue alert...");
123-
$this->installPrologueAlert();
124-
$this->progressBar->advance();
123+
$this->line(" installing prologue alert...");
124+
$this->installPrologueAlert();
125+
$this->progressBar->advance();
125126

126-
$this->line(" dump autoload...");
127-
$this->composer->dumpAutoloads();
128-
$this->progressBar->advance();
127+
$this->line(" dump autoload...");
128+
$this->composer->dumpAutoloads();
129+
$this->progressBar->advance();
129130

130-
$this->progressBar->finish();
131-
$this->info(" finished ".$name." setup with Backpack panel.");
131+
$this->progressBar->finish();
132+
$this->info(" finished ".$name." setup with Backpack panel.");
133+
} else {
134+
$this->progressBar->finish();
135+
$this->line(" failed. already setup for: ".$name);
136+
$this->progressBar->advance();
137+
}
132138
} else {
133139
$this->progressBar->finish();
134-
$this->line(" failed. already setup for: ".$name);
140+
$this->line(" failed: ".$theme_name." theme not found");
135141
$this->progressBar->advance();
136142
}
137143

138144

139-
140-
141145
return true;
142146
}
143147

0 commit comments

Comments
 (0)