Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: upgrade axe-core to 4.4.1 #441

Merged
merged 2 commits into from
Feb 8, 2022
Merged

Conversation

Zidious
Copy link
Contributor

@Zidious Zidious commented Feb 4, 2022

closes issue: #434

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

@straker straker left a comment

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

Copy link
Member

@stephenmathieson stephenmathieson left a comment

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
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants