Skip to content

Commit 02f29b9

Browse files
committed
feat(README-EN.md, README.md): Add warning for unix non-cli environment
- Add a warning note for unix non-cli environment in README-EN.md and README.md - Provide a solution to avoid the error by setting sudo password
1 parent ee54fe7 commit 02f29b9

File tree

3 files changed

+20
-6
lines changed

3 files changed

+20
-6
lines changed

.lintmdrc

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
"no-long-code": [
2424
1,
2525
{
26-
"length": 1000,
26+
"length": 10000,
2727
"exclude": [
2828
"dot"
2929
]
3030
}
3131
]
3232
}
33-
}
33+
}

README-EN.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ $ composer require guanguans/laravel-soar --dev -v
4747

4848
#### laravel
4949

50-
```bash
50+
```shell
5151
$ php artisan vendor:publish --provider="Guanguans\\LaravelSoar\\SoarServiceProvider"
5252
```
5353

@@ -59,6 +59,13 @@ Add the following snippet to the `bootstrap/app.php` file under the `Register Se
5959
$app->register(\Guanguans\LaravelSoar\SoarServiceProvider::class);
6060
```
6161

62+
### :warning: When running in a unix OS non-cli environment, may throw `Fatal error: ...Exit Code: 2(Misuse of shell builtins)...`
63+
64+
```shell
65+
# Fatal error: Uncaught Guanguans\SoarPHP\Exceptions\ProcessFailedException: The command "'/Users/yaozm/Documents/develop/soar-php/bin/soar.darwin-amd64' '-report-type=json' '-query=select * from users;'" failed. Exit Code: 2(Misuse of shell builtins) Working directory: /Users/yaozm/Documents/develop/soar-php Output: ================ Error Output: ================ panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1938665] goroutine 1 [running]: github.com/pingcap/tidb/util/memory.MemTotalNormal() pkg/mod/github.com/pingcap/tidb@v1.1.0-beta.0.20210601085537-5d7c852770eb/util/memory/meminfo.go:41 +0x65 github.com/pingcap/tidb/util/memory.init.0() pkg/mod/github.com/pingcap/tidb@v1.1.0-beta.0.20210601085537-5d7c852770eb/util/memory/meminfo.go:134 +0x175 in /Users/yaozm/Documents/develop/soar-php/src/Concerns/WithRunable.php:36 Stack trace: #0 /Users/yaozm/Documents/develop/soar-php/test.php(163): Guanguans\SoarPHP\Soar->run() #1 /User in /Users/yaozm/Documents/develop/soar-php/src/Concerns/WithRunable.php on line 36
66+
SOAR_SUDO_PASSWORD='your sudo password' # Set a sudo password to run the soar command with sudo to avoid the above errors.
67+
```
68+
6269
## Usage
6370

6471
### Sample code
@@ -614,7 +621,7 @@ namespace Illuminate\Database\Eloquent {
614621

615622
## Testing
616623

617-
```bash
624+
```shell
618625
$ composer test
619626
```
620627

README.md

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,7 @@ $ composer require guanguans/laravel-soar --dev -v
4848

4949
#### laravel
5050

51-
```bash
51+
```shell
5252
$ php artisan vendor:publish --provider="Guanguans\\LaravelSoar\\SoarServiceProvider"
5353
```
5454

@@ -60,6 +60,13 @@ $ php artisan vendor:publish --provider="Guanguans\\LaravelSoar\\SoarServiceProv
6060
$app->register(\Guanguans\LaravelSoar\SoarServiceProvider::class);
6161
```
6262

63+
### :warning: 在 unix 操作系统非 cli 环境中运行时,可能会抛出 `Fatal error: ...Exit Code: 2(Misuse of shell builtins)...`
64+
65+
```shell
66+
# Fatal error: Uncaught Guanguans\SoarPHP\Exceptions\ProcessFailedException: The command "'/Users/yaozm/Documents/develop/soar-php/bin/soar.darwin-amd64' '-report-type=json' '-query=select * from users;'" failed. Exit Code: 2(Misuse of shell builtins) Working directory: /Users/yaozm/Documents/develop/soar-php Output: ================ Error Output: ================ panic: runtime error: invalid memory address or nil pointer dereference [signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x1938665] goroutine 1 [running]: github.com/pingcap/tidb/util/memory.MemTotalNormal() pkg/mod/github.com/pingcap/tidb@v1.1.0-beta.0.20210601085537-5d7c852770eb/util/memory/meminfo.go:41 +0x65 github.com/pingcap/tidb/util/memory.init.0() pkg/mod/github.com/pingcap/tidb@v1.1.0-beta.0.20210601085537-5d7c852770eb/util/memory/meminfo.go:134 +0x175 in /Users/yaozm/Documents/develop/soar-php/src/Concerns/WithRunable.php:36 Stack trace: #0 /Users/yaozm/Documents/develop/soar-php/test.php(163): Guanguans\SoarPHP\Soar->run() #1 /User in /Users/yaozm/Documents/develop/soar-php/src/Concerns/WithRunable.php on line 36
67+
SOAR_SUDO_PASSWORD='your sudo password' # 设置 sudo 密码,以 sudo 运行 soar 命令,避免出现上述错误。
68+
```
69+
6370
## 使用
6471

6572
### 示例代码
@@ -615,7 +622,7 @@ namespace Illuminate\Database\Eloquent {
615622

616623
## 测试
617624

618-
```bash
625+
```shell
619626
$ composer test
620627
```
621628

0 commit comments

Comments
 (0)