chore: use build & start process for development as well #2222
@ -5,4 +5,4 @@ if [ ! -f conf/config.json ]; then
|
||||
jq --arg value "mongodb://openwfagent:spaceninjaserver@mongodb:27017/" '.mongodbUrl = $value' /app/config.json.example > /app/conf/config.json
|
||||
fi
|
||||
|
||||
exec npm run start conf/config.json
|
||||
exec npm run start -- --configPath conf/config.json
|
||||
|
@ -20,11 +20,11 @@ function run(changedFile) {
|
||||
runproc = undefined;
|
||||
}
|
||||
|
||||
buildproc = spawn("npm", ["run", "build", ...args], { stdio: "inherit", shell: true });
|
||||
buildproc = spawn("npm", ["run", "build"], { stdio: "inherit", shell: true });
|
||||
buildproc.on("exit", code => {
|
||||
buildproc = undefined;
|
||||
if (code === 0) {
|
||||
runproc = spawn("npm", ["run", "start", ...args], { stdio: "inherit", shell: true });
|
||||
runproc = spawn("npm", ["run", "start", "--", "--dev", ...args], { stdio: "inherit", shell: true });
|
||||
runproc.on("exit", () => {
|
||||
runproc = undefined;
|
||||
});
|
||||
|
18
src/helpers/commandLineArguments.ts
Normal file
18
src/helpers/commandLineArguments.ts
Normal file
@ -0,0 +1,18 @@
|
||||
interface IArguments {
|
||||
configPath?: string;
|
||||
dev?: boolean;
|
||||
}
|
||||
|
||||
export const args: IArguments = {};
|
||||
|
||||
for (let i = 2; i < process.argv.length; ) {
|
||||
switch (process.argv[i++]) {
|
||||
case "--configPath":
|
||||
args.configPath = process.argv[i++];
|
||||
break;
|
||||
|
||||
case "--dev":
|
||||
args.dev = true;
|
||||
break;
|
||||
}
|
||||
}
|
@ -1,5 +1,4 @@
|
||||
import path from "path";
|
||||
|
||||
export const rootDir = path.join(__dirname, "../..");
|
||||
export const isDev = path.basename(rootDir) != "build";
|
||||
export const repoDir = isDev ? rootDir : path.join(rootDir, "..");
|
||||
export const repoDir = path.basename(rootDir) != "build" ? rootDir : path.join(rootDir, "..");
|
||||
|
@ -1,6 +1,7 @@
|
||||
import fs from "fs";
|
||||
import path from "path";
|
||||
import { repoDir } from "@/src/helpers/pathHelper";
|
||||
import { args } from "@/src/helpers/commandLineArguments";
|
||||
|
||||
export interface IConfig {
|
||||
mongodbUrl: string;
|
||||
@ -79,7 +80,7 @@ export interface IConfig {
|
||||
};
|
||||
}
|
||||
|
||||
export const configPath = path.join(repoDir, process.argv[2] ?? "config.json");
|
||||
export const configPath = path.join(repoDir, args.configPath ?? "config.json");
|
||||
|
||||
export const config: IConfig = {
|
||||
mongodbUrl: "mongodb://127.0.0.1:27017/openWF",
|
||||
|
@ -1,5 +1,5 @@
|
||||
import { unixTimesInMs } from "@/src/constants/timeConstants";
|
||||
import { isDev } from "@/src/helpers/pathHelper";
|
||||
import { args } from "@/src/helpers/commandLineArguments";
|
||||
import { catBreadHash } from "@/src/helpers/stringHelpers";
|
||||
import { TInventoryDatabaseDocument } from "@/src/models/inventoryModels/inventoryModel";
|
||||
import { mixSeeds, SRng } from "@/src/services/rngService";
|
||||
@ -421,7 +421,7 @@ const generateVendorManifest = (vendorInfo: IGeneratableVendorInfo): IVendorMani
|
||||
return cacheEntry;
|
||||
};
|
||||
|
||||
if (isDev) {
|
||||
if (args.dev) {
|
||||
if (
|
||||
getCycleDuration(ExportVendors["/Lotus/Types/Game/VendorManifests/Hubs/TeshinHardModeVendorManifest"]) !=
|
||||
unixTimesInMs.week
|
||||
|
Loading…
x
Reference in New Issue
Block a user