mirror of
				https://github.com/shivammathur/setup-php.git
				synced 2025-11-04 00:46:36 +07:00 
			
		
		
		
	Fix scoped tool setup on Windows
This commit is contained in:
		@ -215,11 +215,12 @@ Function Add-ComposertoolHelper() {
 | 
			
		||||
    $scoped_dir_suffix = (Get-FileHash -InputStream $release_stream -Algorithm sha256).Hash
 | 
			
		||||
    $scoped_dir = "$composer_bin\_tools\$tool-$scoped_dir_suffix"
 | 
			
		||||
    $unix_scoped_dir = $scoped_dir.replace('\', '/')
 | 
			
		||||
    if((composer show $prefix$tool -d $unix_scoped_dir -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
 | 
			
		||||
      composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$release" true >$null 2>&1
 | 
			
		||||
    }
 | 
			
		||||
    if(-not(Test-Path $scoped_dir)) {
 | 
			
		||||
      New-Item -ItemType Directory -Force -Path $scoped_dir > $null 2>&1
 | 
			
		||||
      Set-Content -Path $scoped_dir\composer.json -Value "{}"
 | 
			
		||||
      if((composer show $prefix$tool $tool_version -d $unix_scoped_dir -a 2>&1 | findstr '^type *: *composer-plugin') -and ($composer_args -ne '')) {
 | 
			
		||||
        composer config -d $unix_scoped_dir --no-plugins allow-plugins."$prefix$tool" true >$null 2>&1
 | 
			
		||||
      }
 | 
			
		||||
      composer require $prefix$release -d $unix_scoped_dir $composer_args >$null 2>&1
 | 
			
		||||
    }
 | 
			
		||||
    [System.Environment]::SetEnvironmentVariable(($tool.replace('-', '_') + '_bin'), "$scoped_dir\vendor\bin")
 | 
			
		||||
 | 
			
		||||
		Reference in New Issue
	
	Block a user