SEARCH-197

- Removed the verbose from the tar cmd
- Made shellPath async
This commit is contained in:
Keerthi Niranjan 2017-11-08 20:28:08 +05:30
parent 1bbb1f3ff0
commit 0c159d1d5c
2 changed files with 13 additions and 8 deletions

View File

@ -27,7 +27,7 @@ const lz4Path = isDevEnv ? devPath : productionPath;
*/ */
function compression(pathToFolder, outputPath, callback) { function compression(pathToFolder, outputPath, callback) {
if (isMac) { if (isMac) {
child.exec(`cd "${DATA_FOLDER_PATH}" && tar cvf - "${pathToFolder}" | lz4 > "${outputPath}.tar.lz4"`, (error, stdout, stderr) => { child.exec(`cd "${DATA_FOLDER_PATH}" && tar cf - "${pathToFolder}" | lz4 > "${outputPath}.tar.lz4"`, (error, stdout, stderr) => {
if (error) { if (error) {
return callback(new Error(error), null); return callback(new Error(error), null);
} }
@ -37,7 +37,7 @@ function compression(pathToFolder, outputPath, callback) {
}); });
}) })
} else { } else {
child.exec(`cd "${DATA_FOLDER_PATH}" && "${libraryFolderPath}\\tar-win.exe" cvf - "${pathToFolder}" | "${lz4Path}" > "${outputPath}.tar.lz4"`, (error, stdout, stderr) => { child.exec(`cd "${DATA_FOLDER_PATH}" && "${libraryFolderPath}\\tar-win.exe" cf - "${pathToFolder}" | "${lz4Path}" > "${outputPath}.tar.lz4"`, (error, stdout, stderr) => {
if (error) { if (error) {
return callback(new Error(error), null); return callback(new Error(error), null);
} }

View File

@ -24,12 +24,17 @@ const crypto = new Crypto();
require('electron-dl')(); require('electron-dl')();
//setting the env path child_process issue https://github.com/electron/electron/issues/7688 //setting the env path child_process issue https://github.com/electron/electron/issues/7688
process.env.PATH = shellPath.sync() || [ shellPath()
'./node_modules/.bin', .then((path) => {
'/.nodebrew/current/bin', process.env.PATH = path
'/usr/local/bin', })
process.env.PATH .catch(() => {
].join(':'); process.env.PATH = [
'./node_modules/.bin',
'/usr/local/bin',
process.env.PATH
].join(':');
});
// used to check if a url was opened when the app was already open // used to check if a url was opened when the app was already open
let isAppAlreadyOpen = false; let isAppAlreadyOpen = false;