Skip to content

Commit

Permalink
fix(binary): change condition to set environment
Browse files Browse the repository at this point in the history
  • Loading branch information
yusuftaufiq committed Jun 10, 2022
1 parent 64c017c commit a67f142
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 8 deletions.
1 change: 0 additions & 1 deletion .devcontainer/devcontainer.env

This file was deleted.

1 change: 0 additions & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,6 @@
"features": {
"git": "latest"
},
"runArgs": ["--env-file", ".devcontainer/devcontainer.env"],
"mounts": [
"source=vscode-extensions,target=/home/vscode/.vscode-server/extensions,type=volume",
"source=vscode-insiders-extensions,target=/home/vscode/.vscode-server-insiders/extensions,type=volume"
Expand Down
10 changes: 4 additions & 6 deletions bin/ide-helper
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,20 @@ use Haemanthus\CodeIgniter3IdeHelper\Commands\GenerateHelperCommand;
use Haemanthus\CodeIgniter3IdeHelper\Commands\StartVarDumperCommand;
use Haemanthus\CodeIgniter3IdeHelper\Providers\AppServiceProvider;

define('ENVIRONMENT', getenv('IDE_HELPER_ENV') ?: 'production');

switch (true) {
case isset($_composer_autoload_path):
$autoload = $_composer_autoload_path;
break;

case file_exists(__DIR__ . '/../vendor/autoload.php'):
$autoload = __DIR__ . '/../vendor/autoload.php';
$environment = 'development';
break;

default:
$autoload = __DIR__ . '/../../../autoload.php';
$environment = 'production';
break;
}

define('ENVIRONMENT', $environment);

require_once $autoload;

$container = AppServiceProvider::container();
Expand Down

0 comments on commit a67f142

Please sign in to comment.