mirror of
https://github.com/DeNNiiInc/dbgate.git
synced 2026-04-19 03:45:59 +00:00
archive, export into archive
This commit is contained in:
14
packages/api/src/shell/archiveWriter.js
Normal file
14
packages/api/src/shell/archiveWriter.js
Normal file
@@ -0,0 +1,14 @@
|
||||
const path = require('path');
|
||||
const { archivedir, ensureDirectory } = require('../utility/directories');
|
||||
// const socket = require('../utility/socket');
|
||||
const jsonLinesWriter = require('./jsonLinesWriter');
|
||||
|
||||
function archiveWriter({ folderName, fileName }) {
|
||||
if (folderName == 'default') ensureDirectory(path.join(archivedir(), folderName));
|
||||
const jsonlFile = path.join(archivedir(), folderName, `${fileName}.jsonl`);
|
||||
const res = jsonLinesWriter({ fileName: jsonlFile });
|
||||
// socket.emitChanged(`archive-files-changed-${folderName}`);
|
||||
return res;
|
||||
}
|
||||
|
||||
module.exports = archiveWriter;
|
||||
Reference in New Issue
Block a user