Skip to content

Commit 3dde479

Browse files
committed
in vendor-mode load "project root" vendor autoload
1 parent 289f133 commit 3dde479

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

bin/spc

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ if (PHP_OS_FAMILY !== 'Windows' && PHP_BINARY !== (__DIR__ . '/php') && file_exi
99
pcntl_exec(__DIR__ . '/php', $argv);
1010
}
1111

12-
if (file_exists(dirname(__DIR__) . '/vendor/autoload.php')) {
13-
// Current: ./bin (git/project mode)
14-
require_once dirname(__DIR__) . '/vendor/autoload.php';
15-
} else {
12+
if (file_exists(dirname(__DIR__, 3) . '/autoload.php')) {
1613
// Current: ./vendor/crazywhalecc/static-php-cli/bin (composer library mode)
1714
require_once dirname(__DIR__, 3) . '/autoload.php';
15+
} else {
16+
// Current: ./bin (git/project mode)
17+
require_once dirname(__DIR__) . '/vendor/autoload.php';
1818
}
1919

2020
// 防止 Micro 打包状态下不支持中文的显示(虽然这个项目目前好像没输出过中文?)

0 commit comments

Comments
 (0)