diff --git a/gitactions/publish/achecker-engine.sh b/gitactions/publish/achecker-engine.sh index 47a931cc4..c548f5f9e 100755 --- a/gitactions/publish/achecker-engine.sh +++ b/gitactions/publish/achecker-engine.sh @@ -1,6 +1,6 @@ if [ -n "${GITHUB_REF:10}" ]; then - cd ./accessibility-checker-engine/dist; - cp ../rule-server/dist/static/archives.json + cd ./accessibility-checker-engine/dist + cp ../../rule-server/dist/static/archives.json ./ echo "//registry.npmjs.org/:_authToken=$NPM_TOKEN" >.npmrc; NPM_VERSION="${GITHUB_REF:10}"; echo "Deploy accessibility-checker-engine version ${NPM_VERSION}..."; diff --git a/rule-server/src/main.ts b/rule-server/src/main.ts index 0f2b74fe0..53756ac19 100644 --- a/rule-server/src/main.ts +++ b/rule-server/src/main.ts @@ -84,8 +84,14 @@ export class Server { const archives = require("./static/archives"); let latest = "2020FebDeploy"; + let latestVersion; for (const archive of archives) { - if (archive.latest) { + if (archive.id === "latest") { + latestVersion = archive.version; + } + } + for (const archive of archives) { + if (archive.version === latestVersion) { latest = archive.path; } }