cli: db: support overriding backup/restore dir via HYDRO_BACKUP_DIR (#1215)

This commit is contained in:
ReiAC authored and GitHub committed 2026-10-01 13:25:16 +08:00
1 parent 7c960fad63
commit 816fc88c01
1 file changed
+1 -1
+1 -1
View File
@@ -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);