No Description

MyGet.ps1 1016B

1234567891011121314151617181920
  1. # set env vars usually set by MyGet (enable for local testing)
  2. #$env:SourcesPath = '..'
  3. #$env:NuGet = "./nuget.exe" #https://dist.nuget.org/win-x86-commandline/latest/nuget.exe
  4. $nuget = $env:NuGet
  5. # parse the version number out of package.json
  6. $bsversionParts = ((Get-Content $env:SourcesPath\package.json) -join "`n" | ConvertFrom-Json).version.split('-', 2) # split the version on the '-'
  7. $bsversion = $bsversionParts[0]
  8. if ($bsversionParts.Length -gt 1)
  9. {
  10. $bsversion += '-' + $bsversionParts[1].replace('.', '').replace('-', '_') # strip out invalid chars from the PreRelease part
  11. }
  12. # update sourceMappingURL in bootstrap-select.min.js
  13. (Get-Content $env:SourcesPath\dist\js\bootstrap-select.min.js).replace("sourceMappingURL=", "sourceMappingURL=Scripts/") | Set-Content $env:SourcesPath\dist\js\bootstrap-select.min.js
  14. # create packages
  15. & $nuget pack "$env:SourcesPath\nuget\bootstrap-select.nuspec" -Verbosity detailed -NonInteractive -NoPackageAnalysis -BasePath $env:SourcesPath -Version $bsversion