Skip to content

Commit d792095

Browse files
committed
Improve bower detection on install. Fix issue #231
1 parent a22913d commit d792095

File tree

1 file changed

+15
-4
lines changed

1 file changed

+15
-4
lines changed

DependencyInjection/Configuration.php

+15-4
Original file line numberDiff line numberDiff line change
@@ -93,10 +93,21 @@ private function createSimpleChildren($rootNodeChildren, $withOptions = TRUE)
9393
{
9494
if($withOptions)
9595
{
96-
$rootNodeChildren = $rootNodeChildren->scalarNode('bower_bin')
97-
->info('Path to bower binary')
98-
->defaultValue('/usr/local/bin/bower')
99-
->end();
96+
// Detect dinamically which OS is using and configure on install
97+
if(defined('PHP_WINDOWS_VERSION_MAJOR'))
98+
{
99+
$rootNodeChildren = $rootNodeChildren->scalarNode('bower_bin')
100+
->info('Path to bower binary')
101+
->defaultValue('bower.exe')
102+
->end();
103+
}
104+
else
105+
{
106+
$rootNodeChildren = $rootNodeChildren->scalarNode('bower_bin')
107+
->info('Path to bower binary')
108+
->defaultValue('/usr/local/bin/bower')
109+
->end();
110+
}
100111
}
101112

102113
$rootNodeChildren = $rootNodeChildren->booleanNode('use_assetic')

0 commit comments

Comments
 (0)