This commit is contained in:
Benjamin Toby 2025-02-03 16:23:23 +01:00
parent 1e57cdbc1d
commit 0375c02931
5 changed files with 10 additions and 5 deletions

BIN
bun.lockb

Binary file not shown.

File diff suppressed because one or more lines are too long

5
dist/utils/start.js vendored
View File

@ -4,11 +4,11 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = startProcess;
const fs_1 = __importDefault(require("fs"));
const console_colors_1 = __importDefault(require("./console-colors"));
const preflight_1 = __importDefault(require("./preflight"));
const run_1 = __importDefault(require("./run"));
const kill_child_1 = __importDefault(require("./kill-child"));
const chokidar_1 = __importDefault(require("chokidar"));
let childProcess = null;
const pTitle = "buncid";
process.title = pTitle;
@ -36,7 +36,8 @@ function startProcess({ command, preflight, postflight, redeploy_file, port, fir
process.exit();
}
console.log("Watching", redeploy_file);
fs_1.default.watchFile(redeploy_file, { interval: 100 }, (curr, prev) => {
const watcher = chokidar_1.default.watch(redeploy_file, { ignoreInitial: true });
watcher.on("change", (path, stats) => {
clearTimeout(timeout);
timeout = setTimeout(() => {
console.log(`${console_colors_1.default.BgBlue}File Changed${console_colors_1.default.Reset}`);

View File

@ -1,6 +1,6 @@
{
"name": "@moduletrace/buncid",
"version": "1.0.5",
"version": "1.0.6",
"description": "Simple CI/CD process For Bun runtime",
"main": "dist/index.js",
"bin": {
@ -22,6 +22,7 @@
"author": "Benjamin Toby",
"license": "MIT",
"dependencies": {
"chokidar": "^4.0.3",
"kill-port": "^2.0.1"
},
"devDependencies": {

View File

@ -4,6 +4,7 @@ import colors from "./console-colors";
import preflightFn from "./preflight";
import run from "./run";
import killChild from "./kill-child";
import chokidar from "chokidar";
let childProcess: ChildProcess | null = null;
@ -58,7 +59,9 @@ export default function startProcess({
console.log("Watching", redeploy_file);
fs.watchFile(redeploy_file, { interval: 100 }, (curr, prev) => {
const watcher = chokidar.watch(redeploy_file, { ignoreInitial: true });
watcher.on("change", (path, stats) => {
clearTimeout(timeout);
timeout = setTimeout(() => {