Skip to content

feat: upgrade axe-core to 4.4.1 - #441

Merged
Zidious merged 2 commits into
developfrom
feat/update-axe-core4.4.1
Feb 8, 2022
Merged

feat: upgrade axe-core to 4.4.1#441
Zidious merged 2 commits into
developfrom
feat/update-axe-core4.4.1

Conversation

@Zidious

@Zidious Zidious commented Feb 4, 2022

Copy link
Copy Markdown
Contributor

closes issue: #434

@Zidious
Zidious requested a review from a team February 4, 2022 17:14
straker
straker previously requested changes Feb 7, 2022

@straker straker left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Reporter-earl also needs to be updated to 4.4.1

@stephenmathieson stephenmathieson left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For future time savings...

#!/bin/bash

set -e

function throw() {
  echo "Error: $*"
  exit 1
}

function save_flag() {
  local Result
  Result=$(jq '.devDependencies["axe-core"]' <"$1")
  if [ "$Result" == "null" ]; then
    echo "--save"
  else
    echo "--save-dev"
  fi
}

function update_axe() {
  local Version="$1"
  local Directories

  [ -z "$Version" ] && throw "Missing axe-core version"

  Directories=$(ls -d ./packages/*)

  for Directory in $Directories; do
    local PackageJSON
    local Flag
    echo "Updating $(basename "$Directory")..."

    PackageJSON="$Directory/package.json"
    if [ ! -f "$PackageJSON" ]; then
      echo "Non-package directory found: $Directory"
      continue
    fi

    Flag=$(save_flag "$PackageJSON")
    npm install "axe-core@$Version" "$Flag"
  done
}

update_axe "$1"
@Zidious
Zidious requested review from a team and straker February 7, 2022 20:12
@Zidious
Zidious merged commit 765c81a into develop Feb 8, 2022
@Zidious
Zidious deleted the feat/update-axe-core4.4.1 branch February 8, 2022 14:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

4 participants