Updates
This commit is contained in:
@@ -2,8 +2,10 @@ import { DATASQUIREL_LoggedInUser, UserType } from "../../../types";
|
||||
type Param = {
|
||||
user?: DATASQUIREL_LoggedInUser | UserType;
|
||||
userId?: string | number | null;
|
||||
appDir?: string;
|
||||
};
|
||||
export default function grabDirNames(param?: Param): {
|
||||
appDir: string;
|
||||
schemasDir: string;
|
||||
userDirPath: string | undefined;
|
||||
mainShemaJSONFilePath: string;
|
||||
@@ -22,5 +24,10 @@ export default function grabDirNames(param?: Param): {
|
||||
userPrivateDbImportZipFileName: string;
|
||||
userPrivateDbImportZipFilePath: string | undefined;
|
||||
dbNginxLoadBalancerConfigFile: string;
|
||||
dockerComposeFile: string;
|
||||
testDockerComposeFile: string;
|
||||
siteSetupFile: string;
|
||||
envFile: string;
|
||||
testEnvFile: string;
|
||||
};
|
||||
export {};
|
||||
|
||||
+15
-3
@@ -7,11 +7,12 @@ exports.default = grabDirNames;
|
||||
const path_1 = __importDefault(require("path"));
|
||||
function grabDirNames(param) {
|
||||
var _a;
|
||||
const appDir = process.env.DSQL_APP_DIR;
|
||||
const schemasDir = process.env.DSQL_DB_SCHEMA_DIR;
|
||||
const tempDirName = ".tmp";
|
||||
const appDir = (param === null || param === void 0 ? void 0 : param.appDir) || process.env.DSQL_APP_DIR;
|
||||
if (!appDir)
|
||||
throw new Error("Please provide the `DSQL_APP_DIR` env variable.");
|
||||
const schemasDir = process.env.DSQL_DB_SCHEMA_DIR ||
|
||||
path_1.default.join(appDir, "jsonData", "dbSchemas");
|
||||
const tempDirName = ".tmp";
|
||||
if (!schemasDir)
|
||||
throw new Error("Please provide the `DSQL_DB_SCHEMA_DIR` env variable.");
|
||||
const pakageSharedDir = path_1.default.join(appDir, `package-shared`);
|
||||
@@ -51,7 +52,13 @@ function grabDirNames(param) {
|
||||
? path_1.default.join(userPrivateSQLExportsDir, userPrivateDbImportZipFileName)
|
||||
: undefined;
|
||||
const dbNginxLoadBalancerConfigFile = path_1.default.join(appDir, "docker/mariadb/load-balancer/config/template/nginx.conf");
|
||||
const dockerComposeFile = path_1.default.join(appDir, "docker-compose.yml");
|
||||
const testDockerComposeFile = path_1.default.join(appDir, "test.docker-compose.yml");
|
||||
const siteSetupFile = path_1.default.join(appDir, "site-setup.json");
|
||||
const envFile = path_1.default.join(appDir, ".env");
|
||||
const testEnvFile = path_1.default.join(appDir, "test.env");
|
||||
return {
|
||||
appDir,
|
||||
schemasDir,
|
||||
userDirPath,
|
||||
mainShemaJSONFilePath,
|
||||
@@ -70,5 +77,10 @@ function grabDirNames(param) {
|
||||
userPrivateDbImportZipFileName,
|
||||
userPrivateDbImportZipFilePath,
|
||||
dbNginxLoadBalancerConfigFile,
|
||||
dockerComposeFile,
|
||||
testDockerComposeFile,
|
||||
siteSetupFile,
|
||||
envFile,
|
||||
testEnvFile,
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user