More async fixes the bug
This commit is contained in:
parent
69115d9d79
commit
bf925cfb88
17
server.js
17
server.js
|
@ -298,12 +298,19 @@ 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, () => {
|
||||||
|
|
||||||
// Don't forget to copy the hashed password.
|
console.log("copying from " +
|
||||||
fs.copyFileSync(
|
pathtools.join(movePath, "__bcrypt__hash.txt") +
|
||||||
pathtools.join(movePath, "__bcrypt__hash.txt"),
|
" to " +
|
||||||
pathtools.join(path, "__bcrypt__hash.txt"));
|
pathtools.join(path, "__bcrypt__hash.txt"));
|
||||||
|
|
||||||
|
// Don't forget to copy the hashed password.
|
||||||
|
fs.copyFileSync(
|
||||||
|
pathtools.join(movePath, "__bcrypt__hash.txt"),
|
||||||
|
pathtools.join(path, "__bcrypt__hash.txt"));
|
||||||
|
|
||||||
|
});
|
||||||
|
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue