From 09753cc1fa7777c9deab514ab95e8931728382ea Mon Sep 17 00:00:00 2001 From: Juan Picado Date: Fri, 21 Apr 2023 23:31:11 +0200 Subject: [PATCH] fix wrong htpasswd file location (#3750) --- .changeset/silly-moose-watch.md | 5 +++++ packages/plugins/htpasswd/src/htpasswd.ts | 4 ++-- 2 files changed, 7 insertions(+), 2 deletions(-) create mode 100644 .changeset/silly-moose-watch.md diff --git a/.changeset/silly-moose-watch.md b/.changeset/silly-moose-watch.md new file mode 100644 index 000000000..3b84ddb05 --- /dev/null +++ b/.changeset/silly-moose-watch.md @@ -0,0 +1,5 @@ +--- +'verdaccio-htpasswd': patch +--- + +fix wrong htpasswd file location diff --git a/packages/plugins/htpasswd/src/htpasswd.ts b/packages/plugins/htpasswd/src/htpasswd.ts index ce6ed669d..fa034e83c 100644 --- a/packages/plugins/htpasswd/src/htpasswd.ts +++ b/packages/plugins/htpasswd/src/htpasswd.ts @@ -1,6 +1,6 @@ import buildDebug from 'debug'; import fs from 'fs'; -import { dirname, join, resolve } from 'path'; +import { dirname, resolve } from 'path'; import { pluginUtils } from '@verdaccio/core'; import { unlockFile } from '@verdaccio/file-locking'; @@ -90,7 +90,7 @@ export default class HTPasswd throw new Error('should specify "file" in config'); } debug('config path: %s', options?.config?.configPath); - this.path = join(resolve(dirname(options?.config?.configPath ?? '')), file); + this.path = resolve(dirname(options?.config?.configPath), file); this.logger.info({ file: this.path }, 'using htpasswd file: @{file}'); debug('htpasswd path:', this.path); if (config.slow_verify_ms) {