From 87a03dc5d6e392f148b210d4e4cab764e0e422c5 Mon Sep 17 00:00:00 2001 From: scrwdrv Date: Wed, 15 Jan 2020 02:22:42 +0800 Subject: [PATCH] Auto commit @auto-committer 4 files Modified: [index.js](+5)(-3), [lib/master.js](+1)(-0), [package.json](+1)(-1), [src/master.ts](+2)(-0) --- index.js | 8 +++++--- lib/master.js | 1 + package.json | 2 +- src/master.ts | 2 ++ 4 files changed, 9 insertions(+), 4 deletions(-) diff --git a/index.js b/index.js index e1e0079..c782a86 100644 --- a/index.js +++ b/index.js @@ -1,5 +1,7 @@ #!/usr/bin/env node -"use strict"; -if (process.env.isWorker) require('./lib/worker'); -else require('./lib/master'); +'use strict'; +if (process.env.isWorker) + Promise.resolve().then(() => require('./lib/worker')); +else + Promise.resolve().then(() => require('./lib/master')); process.on('SIGINT', () => { }); \ No newline at end of file diff --git a/lib/master.js b/lib/master.js index 6a52ef6..0ec2ed5 100644 --- a/lib/master.js +++ b/lib/master.js @@ -10,6 +10,7 @@ const crypto = require("crypto"); const dir = require("recurdir"); const PATH = require("path"); const fs = require("fs"); +__dirname = PATH.join(__dirname, '../'); const cpc = new worker_communication_1.default(), prompt = new prompt_1.default(), logServer = new cluster_ipc_logger_1.loggerServer({ debug: false, directory: PATH.join(__dirname, 'logs'), diff --git a/package.json b/package.json index a60bc9b..d9f288b 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "safe-backup", - "version": "1.0.8", + "version": "1.0.9", "description": "A CLI tool that helps you backup file or folder into a single password encrypted file. Using technology of Tar & AES.", "main": "init.js", "scripts": { diff --git a/src/master.ts b/src/master.ts index e7cf10b..f7141bb 100644 --- a/src/master.ts +++ b/src/master.ts @@ -9,6 +9,8 @@ import * as dir from 'recurdir'; import * as PATH from 'path'; import * as fs from 'fs'; +__dirname = PATH.join(__dirname, '../'); + declare global { interface Config { input: string[];