Use yarn to install global tools (#9904)

This commit is contained in:
Reece Dunham 2019-06-17 12:10:56 -07:00 committed by Travis Plunk
parent f65497711e
commit b17b6bd361
5 changed files with 8 additions and 29 deletions

View file

@ -44,10 +44,7 @@ jobs:
condition: succeededOrFailed()
- bash: |
# Installing globally with yarn is a pain, please don't try
sudo npm install -g markdown-spellcheck@0.11.0
# Sometimes this folder is left behind with root permissions and is needed by later npm installs which don't need sudo
sudo rm -rf ~/.npm/_cacache
sudo yarn global add markdown-spellcheck@0.11.0
displayName: Install mdspell
condition: succeededOrFailed()

View file

@ -1,15 +0,0 @@
# Copyright (c) Microsoft Corporation. All rights reserved.
# Licensed under the MIT License.
Start-Process `
-FilePath "npm" `
-ArgumentList @('install','rimraf','-g','--silent') `
-Wait `
-WorkingDirectory $PSScriptRoot `
-NoNewWindow
Start-Process `
-FilePath "rimraf" `
-ArgumentList @(Join-Path -Path $PSScriptRoot -ChildPath 'node_modules') `
-Wait `
-WorkingDirectory $PSScriptRoot `
-NoNewWindow

View file

@ -8,9 +8,7 @@ Describe "Verify Markdown Links" {
{
Write-Verbose "installing markdown-link-check ..." -Verbose
start-nativeExecution {
sudo npm install -g markdown-link-check@3.7.2
# Sometimes this folder is left behind with root permissions and is needed by later NPM installs which don't need sudo
sudo rm -rf ~/.npm/_cacache
sudo yarn global add markdown-link-check@3.7.2
}
}
@ -49,7 +47,7 @@ Describe "Verify Markdown Links" {
$jobs.add($group.name,$job)
}
Write-Verbose -verbose "Getting and printing results ..."
Write-Verbose -verbose "Getting results ..."
# Get the results and verify
foreach($key in $jobs.keys)
{
@ -105,7 +103,8 @@ Describe "Verify Markdown Links" {
if($url -match '^http(s)?:')
{
# If invoke-WebRequest can handle the URL, re-verify, with 5 retries
try{
try
{
$null = Invoke-WebRequest -uri $url -RetryIntervalSec 3 -MaximumRetryCount 6
}
catch

View file

@ -22,10 +22,7 @@ Describe 'Common Tests - Validate Markdown Files' -Tag 'CI' {
if(!(Get-Command -Name 'gulp' -ErrorAction SilentlyContinue))
{
start-nativeExecution {
# Installing globally with yarn is a pain, please don't try it
sudo npm install -g 'gulp@4.0.0' --silent
# Sometimes this folder is left behind with root permissions and is needed by later NPM installs which don't need sudo
sudo rm -rf ~/.npm/_cacache
sudo yarn global add 'gulp@4.0.0'
}
}
if(!(Get-Command -Name 'node' -ErrorAction SilentlyContinue))

View file

@ -1,7 +1,8 @@
{
"name": "powershell.common.markdown.tests",
"private": true,
"version": "1.0.0",
"description": "The PowerShell Common MarkDown Tests.",
"description": "The PowerShell Common Markdown Tests.",
"main": "gulpfile.js",
"dependencies": {
"gulp": "^4.0.2",