Skip to content

Commit edfca9f

Browse files
omerdrukmansergiohgz
authored andcommitted
feat: change new db name to verdaccio (#83)
* feat: change new db name to verdaccio * feat: change new db name to verdaccio
1 parent faf85e4 commit edfca9f

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

plugins/local-storage/src/local-database.js

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -246,7 +246,16 @@ class LocalDatabase implements IPluginStorage {
246246
* @private
247247
*/
248248
_buildStoragePath(config: Config) {
249-
return Path.join(Path.resolve(Path.dirname(config.self_path || ''), (config: any).storage, '.sinopia-db.json'));
249+
const dbGenPath = function(dbName) {
250+
return Path.join(Path.resolve(Path.dirname(config.self_path || ''), (config: any).storage, dbName));
251+
};
252+
253+
const sinopiadbPath = dbGenPath('.sinopia-db.json');
254+
if (fs.existsSync(sinopiadbPath)) {
255+
return sinopiadbPath;
256+
}
257+
258+
return dbGenPath('.verdaccio-db.json');
250259
}
251260

252261
/**

0 commit comments

Comments
 (0)