Skip to content

Commit 4fb80f1

Browse files
committed
update metro.md
1 parent d8097bc commit 4fb80f1

File tree

2 files changed

+48
-12
lines changed

2 files changed

+48
-12
lines changed

app/Http/Controllers/ProcessController.php

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -20,40 +20,46 @@ public function siteUpdate(Request $request)
2020
try {
2121
// Specify the project root directory
2222
$projectRoot = base_path();
23-
23+
2424
// Run git reset
2525
$gitReset = Process::path($projectRoot)->run('git reset --hard');
2626
if ($gitReset->failed()) {
27-
Log::error('Git reset failed: ' . $gitReset->errorOutput());
27+
Log::error('Git reset failed: '.$gitReset->errorOutput());
28+
2829
return response()->json(['status' => 'failed', 'error_code' => 10, 'message' => 'Git reset failed']);
2930
}
30-
31+
3132
// Run git pull
3233
$gitPull = Process::path($projectRoot)->run('git pull');
3334
if ($gitPull->failed()) {
34-
Log::error('Git pull failed: ' . $gitPull->errorOutput());
35+
Log::error('Git pull failed: '.$gitPull->errorOutput());
36+
3537
return response()->json(['status' => 'failed', 'error_code' => 11, 'message' => 'Git pull failed']);
3638
}
37-
39+
3840
// Run migrations
3941
$exitCodeMigrate = Artisan::call('migrate', ['--force' => true]);
4042
if ($exitCodeMigrate !== 0) {
41-
Log::error('Migration failed with exit code: ' . $exitCodeMigrate);
43+
Log::error('Migration failed with exit code: '.$exitCodeMigrate);
44+
4245
return response()->json(['status' => 'failed', 'error_code' => 12, 'message' => 'Migration failed']);
4346
}
44-
47+
4548
// Optimize the application
4649
$exitCodeOptimize = Artisan::call('optimize');
4750
if ($exitCodeOptimize !== 0) {
48-
Log::error('Optimization failed with exit code: ' . $exitCodeOptimize);
51+
Log::error('Optimization failed with exit code: '.$exitCodeOptimize);
52+
4953
return response()->json(['status' => 'failed', 'error_code' => 13, 'message' => 'Optimization failed']);
5054
}
51-
55+
5256
Log::info('Site update completed successfully');
57+
5358
return response()->json(['status' => 'ok', 'error_code' => 0]);
54-
59+
5560
} catch (\Exception $e) {
56-
Log::error('Site update failed with exception: ' . $e->getMessage());
61+
Log::error('Site update failed with exception: '.$e->getMessage());
62+
5763
return response()->json(['status' => 'failed', 'error_code' => 500, 'message' => $e->getMessage()]);
5864
}
5965
}

resources/docs/6.x/metro.md

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -46,7 +46,7 @@ It provides a lot of helpful tools to speed up development.
4646

4747
## Install
4848

49-
Mac guide
49+
#### Mac guide
5050

5151
**Run the below command from the terminal**
5252

@@ -97,6 +97,36 @@ All commands:
9797
motivation:quote
9898
```
9999

100+
#### Windows Guide
101+
102+
1. Open PowerShell as an administrator.
103+
2. Create a PowerShell profile if you don't have one:
104+
105+
``` bash
106+
if (!(Test-Path -Path $PROFILE)) {
107+
New-Item -ItemType File -Path $PROFILE -Force
108+
}
109+
```
110+
111+
3. Open the profile in a text editor:
112+
113+
``` bash
114+
notepad $PROFILE
115+
```
116+
117+
4. Add the following line to the profile:
118+
119+
``` bash
120+
function metro { dart run nylo_framework:main @args }
121+
```
122+
123+
5. Save the file and close the editor.
124+
6. Reload your PowerShell profile:
125+
126+
``` bash
127+
. $PROFILE
128+
```
129+
100130
<div id="make-controller"></div>
101131
<br>
102132

0 commit comments

Comments
 (0)