More async fixes the bug

This commit is contained in:
Thomas Forgione 2019-03-28 14:44:42 +01:00
parent 69115d9d79
commit bf925cfb88
No known key found for this signature in database
GPG Key ID: 203DAEA747F48F41
1 changed files with 12 additions and 5 deletions

View File

@ -298,13 +298,20 @@ function startServer() {
// If we're here, it means that we found the right path. We // If we're here, it means that we found the right path. We
// will move the old one to the old directories, and save // will move the old one to the old directories, and save
// the new one // the new one
fs.renameSync(path, movePath); fs.rename(path, movePath, () => {
console.log("copying from " +
pathtools.join(movePath, "__bcrypt__hash.txt") +
" to " +
pathtools.join(path, "__bcrypt__hash.txt"));
// Don't forget to copy the hashed password. // Don't forget to copy the hashed password.
fs.copyFileSync( fs.copyFileSync(
pathtools.join(movePath, "__bcrypt__hash.txt"), pathtools.join(movePath, "__bcrypt__hash.txt"),
pathtools.join(path, "__bcrypt__hash.txt")); pathtools.join(path, "__bcrypt__hash.txt"));
});
break; break;
} }
} }