This commit is contained in:
Benjamin Toby
2025-07-15 10:02:20 +01:00
parent 8865292893
commit a71614cb0f
18 changed files with 99 additions and 34 deletions
+10 -2
View File
@@ -3,12 +3,19 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const fs_1 = __importDefault(require("fs"));
const child_process_1 = require("child_process");
const files_1 = __importDefault(require("./watch/files"));
const folders_1 = __importDefault(require("./watch/folders"));
const path_1 = __importDefault(require("path"));
const confFileProvidedJSON = process.argv[process.argv.length - 1];
global.SYNCING = false;
global.SYNC_SUCCESS_EXIT_CODE = 32;
global.CONFIG_DIR = process.cwd();
global.SYNCING_FILE = path_1.default.join(global.CONFIG_DIR, "syncing.txt");
try {
if (fs_1.default.existsSync(global.SYNCING_FILE)) {
process.exit(0);
}
const configFileObject = JSON.parse(confFileProvidedJSON);
console.log(`Running '${configFileObject.title}' ...`);
if (Array.isArray(configFileObject.files) &&
@@ -32,7 +39,8 @@ catch (error) {
process.exit();
}
process.on("exit", (code) => {
if (code == 1) {
if (code == global.SYNC_SUCCESS_EXIT_CODE) {
fs_1.default.unlinkSync(global.SYNCING_FILE);
const args = process.argv;
const cmd = args.shift();
if (cmd) {