Skip to content
This repository has been archived by the owner on Jun 29, 2018. It is now read-only.

Commit

Permalink
Various fixes to auto-update script:
Browse files Browse the repository at this point in the history
 - Avoid conflicting `babelrc`s from node_modules
 - Add `-UseBasicParsing` to WebRequest so it works in situations where the MSIE engine is not available (we don't need that fancy stuff)
- Split `npm-check-updates` call into several calls, as the one regex wasn't working as expected
  • Loading branch information
Daniel15 committed May 14, 2017
1 parent 7fe7fdb commit dddbc9f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 2 deletions.
6 changes: 5 additions & 1 deletion gulpfile.js
Expand Up @@ -15,7 +15,11 @@ function webpackBuild(filename, libraryName, version) {
test: /\.js$/,
loader: 'babel',
query: {
presets: ['es2015', 'stage-0']
// Some of the node_modules may have their own "babel" section in
// their project.json (or a ".babelrc" file). We need to ignore
// those as we're using our own Babel options.
babelrc: false,
presets: ['es2015', 'stage-0'],
}
},
{
Expand Down
6 changes: 5 additions & 1 deletion scripts/update.ps1
Expand Up @@ -90,6 +90,7 @@ function Add-GitHubReleaseAsset(
-Uri ('{0}?name={1}&access_token={2}' -f $upload_url, $filename, $Env:GITHUB_TOKEN) `
-Method Post `
-ContentType 'text/javascript; charset=utf-8' `
-UseBasicParsing `
-Body (Get-Content -Path $Path -Raw -Encoding UTF8) | Out-Null

Write-Output ('Uploaded ' + $filename)
Expand All @@ -112,7 +113,10 @@ if ($Clean) {

# We need to run npm install in order to be able to use npm-check-updates
npm install; Assert-LastExitCode
.\node_modules\.bin\npm-check-updates -a /^babel/; Assert-LastExitCode
#.\node_modules\.bin\npm-check-updates -u -a --packageFile ./package.json /^babel\-(plugin|preset|core)/; Assert-LastExitCode
.\node_modules\.bin\npm-check-updates -u -a --packageFile ./package.json /^babel\-plugin/; Assert-LastExitCode
.\node_modules\.bin\npm-check-updates -u -a --packageFile ./package.json /^babel\-preset/; Assert-LastExitCode
.\node_modules\.bin\npm-check-updates -u -a --packageFile ./package.json /^babel\-core/; Assert-LastExitCode

$package_json = Get-Content -Path package.json | ConvertFrom-Json
$babel_version = Get-LatestDependencyVersion -Package $package_json -Filter 'babel\-(plugin|preset|core)'
Expand Down

0 comments on commit dddbc9f

Please sign in to comment.