mirror of
https://github.com/labring/FastGPT.git
synced 2025-07-23 13:03:50 +00:00

* perf: system plugin auto save file * feat: http support jsonPath * fix: assistant response * reset milvus version * fix: textarea register * fix: global variable * delete tip * doc
16 lines
389 B
TypeScript
16 lines
389 B
TypeScript
import path from 'path';
|
|
import * as fs from 'fs';
|
|
|
|
const isProduction = process.env.NODE_ENV === 'production';
|
|
|
|
export const getFileSavePath = (name: string) => {
|
|
if (isProduction) {
|
|
return `/app/plugin_file/${name}`;
|
|
}
|
|
const filePath = path.join(process.cwd(), 'local', 'plugin_file', name);
|
|
|
|
fs.mkdirSync(path.dirname(filePath), { recursive: true });
|
|
|
|
return filePath;
|
|
};
|