Updates
This commit is contained in:
+11
-1
@@ -1,13 +1,21 @@
|
||||
import fs from "fs";
|
||||
import { spawn } from "child_process";
|
||||
import watchFiles from "./watch/files";
|
||||
import watchFolders from "./watch/folders";
|
||||
import { TurboSyncConfigObject } from "../types";
|
||||
import path from "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.join(global.CONFIG_DIR, "syncing.txt");
|
||||
|
||||
try {
|
||||
if (fs.existsSync(global.SYNCING_FILE)) {
|
||||
process.exit(0);
|
||||
}
|
||||
|
||||
const configFileObject: TurboSyncConfigObject =
|
||||
JSON.parse(confFileProvidedJSON);
|
||||
|
||||
@@ -39,6 +47,8 @@ try {
|
||||
|
||||
process.on("exit", (code) => {
|
||||
if (code == global.SYNC_SUCCESS_EXIT_CODE) {
|
||||
fs.unlinkSync(global.SYNCING_FILE);
|
||||
|
||||
const args = process.argv;
|
||||
const cmd = args.shift();
|
||||
if (cmd) {
|
||||
|
||||
Reference in New Issue
Block a user