File tree Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Expand file tree Collapse file tree 1 file changed +13
-5
lines changed Original file line number Diff line number Diff line change @@ -11,12 +11,20 @@ echo PHP_EOL.
1111 ' |_| ' .PHP_EOL .PHP_EOL .
1212 '=========================================================== ' .PHP_EOL .PHP_EOL ;
1313
14- if (file_exists ($ sComposerAutoloader = __DIR__ .'/../vendor/autoload.php ' )){
15- require $ sComposerAutoloader ;
14+ $ sComposerAutoloaderWorkingDirectory = getcwd () . '/vendor/autoload.php ' ;
15+ if (is_file ($ sComposerAutoloaderWorkingDirectory )) {
16+ require_once $ sComposerAutoloaderWorkingDirectory ;
1617}
17- else {
18- printError ('Composer autoload file " ' .$ sComposerAutoloader .'" does not exist ' );
19- exit (1 );
18+
19+ if (!class_exists ('CssLint\Linter ' , true )) {
20+ // consider being in bin dir
21+ $ sComposerAutoloader = __DIR__ . '/../vendor/autoload.php ' ;
22+ if (!is_file ($ sComposerAutoloader )) {
23+ // consider being in vendor/neilime/php-css-lint/scripts
24+ $ sComposerAutoloader = __DIR__ . '/../../../autoload.php ' ;
25+ }
26+
27+ require_once $ sComposerAutoloader ;
2028}
2129
2230function printUsage (){
You can’t perform that action at this time.
0 commit comments