mirror of
https://gitcode.com/gh_mirrors/hy/Hydro.git
synced 2026-10-17 09:36:08 +08:00
cli: db: support overriding backup/restore dir via HYDRO_BACKUP_DIR (#1215)
This commit is contained in:
1 parent
7c960fad63
commit
816fc88c01
1 file changed
+1
-1
@@ -16,7 +16,7 @@ const exec = (...args: Parameters<typeof child.spawnSync>) => {
|
||||
if (res.status) throw new Error(`Error: Exited with code ${res.status}`);
|
||||
return res;
|
||||
};
|
||||
const dir = `${os.tmpdir()}/${Math.random().toString(36).substring(2)}`;
|
||||
const dir = process.env.HYDRO_BACKUP_DIR || `${os.tmpdir()}/${Math.random().toString(36).substring(2)}`;
|
||||
function getUrl() {
|
||||
const dbConfig = fs.readFileSync(path.resolve(hydroPath, 'config.json'), 'utf-8');
|
||||
const opts = JSON.parse(dbConfig);
|
||||
|
||||
Reference in new issue
Block a user