-
-
Notifications
You must be signed in to change notification settings - Fork 32
Conversation
src/local-database.js
Outdated
@@ -246,7 +246,12 @@ class LocalDatabase implements IPluginStorage { | |||
* @private | |||
*/ | |||
_buildStoragePath(config: Config) { | |||
return Path.join(Path.resolve(Path.dirname(config.self_path || ''), (config: any).storage, '.sinopia-db.json')); | |||
const sinopiadbPath = Path.join(Path.resolve(Path.dirname(config.self_path || ''), (config: any).storage, '.sinopia-db.json')); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perfect, only Path.join(Path.resolve(Path.dirname(config.self_path || ''), (config: any).storage,
might be a function inside of _buildStoragePath
. The code is dupe.
const buildDBPath = (name) => Path.join(Path.resolve(Path.dirname(config.self_path || ''), (config: any).storage, name));
...
const sinopiadbPath = buildDBPath('.sinopia-db.json');
...
return buildDBPath('.verdaccio-db.json');
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Small change
You are right. I added the function inside _buildStoragePath, and used it twice, for 'sinopia-db.json' and 'verdaccio-db.json'. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
👍 perfect ! Thanks. I'll publish and I'll let you know the version to update the main repo.
Great:) thank you! |
Type: feature
The following has been addressed in the PR:
Description:
Detect whether .sinopia-db.json is exist otherwise set db path to .verdaccio-db.json.