Bugfix: fix race conditions
This commit is contained in:
Vendored
-18
@@ -36,16 +36,12 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
||||
return (mod && mod.__esModule) ? mod : { "default": mod };
|
||||
};
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
const child_process_1 = require("child_process");
|
||||
const files_1 = __importDefault(require("./watch/files"));
|
||||
const folders_1 = __importDefault(require("./watch/folders"));
|
||||
const get_last_edited_src_1 = __importDefault(require("../utils/get-last-edited-src"));
|
||||
const grab_folders_files_string_paths_1 = __importStar(require("../utils/grab-folders-files-string-paths"));
|
||||
const confFileProvidedJSON = process.argv[process.argv.length - 1];
|
||||
global.SYNC_SUCCESS_EXIT_CODE = 32;
|
||||
global.CONFIG_DIR = process.cwd();
|
||||
global.SYNCING = false;
|
||||
const REWATCH_TIMEOUT = 1000;
|
||||
try {
|
||||
const configFileObject = JSON.parse(confFileProvidedJSON);
|
||||
const lastUpdated = (0, get_last_edited_src_1.default)({
|
||||
@@ -88,17 +84,3 @@ catch (error) {
|
||||
console.log(error);
|
||||
process.exit();
|
||||
}
|
||||
process.on("exit", (code) => {
|
||||
if (code == global.SYNC_SUCCESS_EXIT_CODE) {
|
||||
const args = process.argv;
|
||||
const cmd = args.shift();
|
||||
if (cmd) {
|
||||
(0, child_process_1.spawn)(cmd, args, {
|
||||
stdio: "inherit",
|
||||
});
|
||||
}
|
||||
}
|
||||
else {
|
||||
process.exit(0);
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user