Skip to content
This repository was archived by the owner on Aug 16, 2019. It is now read-only.

feat: change new db name to verdaccio #83

Merged
merged 2 commits into from
Aug 25, 2018

Conversation

omerdrukman
Copy link
Contributor

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.

@@ -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'));
Copy link
Member

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');

Copy link
Member

@juanpicado juanpicado left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Small change

@omerdrukman
Copy link
Contributor Author

omerdrukman commented Aug 25, 2018

You are right. I added the function inside _buildStoragePath, and used it twice, for 'sinopia-db.json' and 'verdaccio-db.json'.

Copy link
Member

@juanpicado juanpicado left a 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.

@juanpicado juanpicado merged commit 143977d into verdaccio:master Aug 25, 2018
@omerdrukman
Copy link
Contributor Author

Great:) thank you!

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants