From c46cdf34e326c1ac9191591bd2cb35875a7b94e3 Mon Sep 17 00:00:00 2001 From: Patrik Oldsberg Date: Tue, 27 Oct 2020 10:00:40 +0100 Subject: [PATCH] scaffolder-backend: fix review nit --- .../src/scaffolder/stages/prepare/preparers.ts | 6 +++--- .../src/scaffolder/stages/publish/publishers.ts | 7 +++---- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.ts b/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.ts index 59537e73f4..226f7e3836 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/prepare/preparers.ts @@ -46,9 +46,9 @@ export class Preparers implements PreparerBuilder { if (!preparer) { if ((protocol as string) === 'url') { const type = this.typeDetector?.(location); - const preparer2 = type && this.preparerMap.get(type as RemoteProtocol); - if (preparer2) { - return preparer2; + const detected = type && this.preparerMap.get(type as RemoteProtocol); + if (detected) { + return detected; } throw new Error(`No preparer integration found for url "${location}"`); } diff --git a/plugins/scaffolder-backend/src/scaffolder/stages/publish/publishers.ts b/plugins/scaffolder-backend/src/scaffolder/stages/publish/publishers.ts index 23f15745ba..db383aaf7f 100644 --- a/plugins/scaffolder-backend/src/scaffolder/stages/publish/publishers.ts +++ b/plugins/scaffolder-backend/src/scaffolder/stages/publish/publishers.ts @@ -47,10 +47,9 @@ export class Publishers implements PublisherBuilder { if (!publisher) { if ((protocol as string) === 'url') { const type = this.typeDetector?.(location); - const publisher2 = - type && this.publisherMap.get(type as RemoteProtocol); - if (publisher2) { - return publisher2; + const detected = type && this.publisherMap.get(type as RemoteProtocol); + if (detected) { + return detected; } throw new Error(`No preparer integration found for url "${location}"`); }