{this.state.second_stage ? (
this.state.checked.map((path) => {
return (
@@ -235,11 +218,7 @@ export default connect(
/>
),
uncheck: (
-
+
),
halfCheck: (
{
text={'Skylink'}
style={{ minWidth: '33.33%', maxWidth: '33.33%' }}
/>
-
+
diff --git a/src/containers/SkynetImport/SkynetImport.js b/src/containers/SkynetImport/SkynetImport.js
index 633501b..6dcee39 100644
--- a/src/containers/SkynetImport/SkynetImport.js
+++ b/src/containers/SkynetImport/SkynetImport.js
@@ -21,8 +21,7 @@ const mapStateToProps = (state) => {
const mapDispatchToProps = (dispatch) => {
return {
displaySkynetImport: (display) => dispatch(displaySkynetImport(display)),
- notifyApplicationBusy: (busy) =>
- dispatch(notifyApplicationBusy(busy, true)),
+ notifyApplicationBusy: (busy) => dispatch(notifyApplicationBusy(busy, true)),
notifyError: (msg) => dispatch(notifyError(msg)),
notifyInfo: (title, msg) => dispatch(notifyInfo(title, msg)),
};
@@ -40,10 +39,7 @@ export default connect(
};
componentDidMount() {
- this.setRequestHandler(
- Constants.IPC_Import_Skylinks_Reply,
- this.onImportSkylinksReply
- );
+ this.setRequestHandler(Constants.IPC_Import_Skylinks_Reply, this.onImportSkylinksReply);
}
componentWillUnmount() {
@@ -119,9 +115,7 @@ export default connect(
part = part.trim();
const pair = part.split('=');
if (pair.length !== 2) {
- throw new Error(
- 'Invalid syntax for import: directory="",skylink="",token=""'
- );
+ throw new Error('Invalid syntax for import: directory="",skylink="",token=""');
}
importItem = {
...importItem,
@@ -129,9 +123,7 @@ export default connect(
};
}
if (!importItem.skylink) {
- throw new Error(
- 'Invalid syntax for import: directory="",skylink="",token=""'
- );
+ throw new Error('Invalid syntax for import: directory="",skylink="",token=""');
}
importsArray.push(importItem);
} else if (item.length > 0) {
@@ -165,22 +157,15 @@ export default connect(
this.setState(
{
import_text:
- failedImportsArray.length > 0
- ? JSON.stringify(failedImportsArray, null, 2)
- : '',
+ failedImportsArray.length > 0 ? JSON.stringify(failedImportsArray, null, 2) : '',
imports_array: [],
second_stage: false,
},
() => {
if (failedImportsArray.length > 0) {
- this.props.notifyError(
- `Failed to import ${failedImportsArray.length} item(s)`
- );
+ this.props.notifyError(`Failed to import ${failedImportsArray.length} item(s)`);
} else {
- this.props.notifyInfo(
- 'Import Result',
- `Successfully imported ${count} item(s)`
- );
+ this.props.notifyInfo('Import Result', `Successfully imported ${count} item(s)`);
}
}
);
diff --git a/src/containers/UI/Password/Password.js b/src/containers/UI/Password/Password.js
index 13e0e05..bef623a 100644
--- a/src/containers/UI/Password/Password.js
+++ b/src/containers/UI/Password/Password.js
@@ -48,10 +48,7 @@ export default class Password extends Component {
this.props.changed(this.state.password);
this.setState({
...this.state,
- button_text:
- this.state.password && this.state.password.length > 0
- ? 'clear'
- : 'set',
+ button_text: this.state.password && this.state.password.length > 0 ? 'clear' : 'set',
password2: '',
});
} else {
@@ -119,10 +116,7 @@ export default class Password extends Component {
return (
{this.props.readOnly ? null : (
-
+
{this.state.button_text}
)}
@@ -134,20 +128,10 @@ export default class Password extends Component {
onChange={this.handlePasswordChanged}
onKeyUp={this.handlePasswordKeyUp}
type={this.state.show_password ? 'text' : 'password'}
- value={
- this.state.button_text === 'confirm'
- ? this.state.password2
- : this.state.password
- }
+ value={this.state.button_text === 'confirm' ? this.state.password2 : this.state.password}
/>
-
-
+
+
);
diff --git a/src/helpers.js b/src/helpers.js
index b1faffa..b5c53bf 100644
--- a/src/helpers.js
+++ b/src/helpers.js
@@ -40,12 +40,7 @@ const _vcRuntimeExists = () => {
args2.push('REG_SZ');
_execProcessGetOutput(cmd, null, args2)
.then((lines) => {
- const value = lines[2]
- .trim()
- .substr(args2[3].length)
- .trim()
- .substr(6)
- .trim();
+ const value = lines[2].trim().substr(args2[3].length).trim().substr(6).trim();
if (
value.includes(
IS_64BIT
@@ -84,20 +79,14 @@ const _createTreeNodes = (fileList) => {
let tree = {};
const directorySort = (a, b) => {
- return !!a.directory === !!b.directory
- ? a.name.localeCompare(b.name)
- : a.directory
- ? -1
- : 1;
+ return !!a.directory === !!b.directory ? a.name.localeCompare(b.name) : a.directory ? -1 : 1;
};
const addNode = (obj) => {
let fullPath;
const idx = obj.skylink.indexOf('/');
if (idx > -1) {
- fullPath = path
- .join(obj.directory, obj.skylink.substr(idx + 1))
- .replace(/\\/g, '/');
+ fullPath = path.join(obj.directory, obj.skylink.substr(idx + 1)).replace(/\\/g, '/');
} else {
fullPath = path.join(obj.directory, obj.filename).replace(/\\/g, '/');
}
@@ -403,8 +392,7 @@ module.exports.detectRepertoryMounts = (version, providerList) => {
provider,
!Constants.PROVIDER_LIST.includes(provider) &&
provider.toLowerCase().startsWith('remote'),
- !Constants.PROVIDER_LIST.includes(provider) &&
- provider.toLowerCase().startsWith('s3')
+ !Constants.PROVIDER_LIST.includes(provider) && provider.toLowerCase().startsWith('s3')
);
args.push('-status');
@@ -420,12 +408,10 @@ module.exports.detectRepertoryMounts = (version, providerList) => {
});
process.on('exit', () => {
- mountState[provider] =
- _tryParse(result, defaultData)[provider] || defaultData;
+ mountState[provider] = _tryParse(result, defaultData)[provider] || defaultData;
if (
mountState[provider].Active &&
- (mountState[provider].Location === 'elevating' ||
- mountState[provider].Location === '')
+ (mountState[provider].Location === 'elevating' || mountState[provider].Location === '')
) {
setTimeout(() => {
grabStatus(index);
@@ -441,12 +427,7 @@ module.exports.detectRepertoryMounts = (version, providerList) => {
});
};
-module.exports.downloadFile = (
- url,
- destination,
- progressCallback,
- completeCallback
-) => {
+module.exports.downloadFile = (url, destination, progressCallback, completeCallback) => {
try {
if (fs.existsSync(destination)) {
fs.unlinkSync(destination);
@@ -482,9 +463,7 @@ module.exports.downloadFile = (
if (downloaded === 0) {
completeCallback(new Error('Received 0 bytes'));
} else if (downloaded !== total) {
- completeCallback(
- new Error('Received incorrect number of bytes')
- );
+ completeCallback(new Error('Received incorrect number of bytes'));
} else {
completeCallback();
}
@@ -536,9 +515,7 @@ module.exports.executeAsync = (command, args = []) => {
const launchProcess = (count, timeout) => {
let cmd = path.basename(command);
const working =
- cmd.length === command.length
- ? null
- : command.substr(0, command.length - cmd.length);
+ cmd.length === command.length ? null : command.substr(0, command.length - cmd.length);
let processOptions = {
detached: true,
shell: false,
@@ -626,14 +603,7 @@ module.exports.executeScript = (script) => {
});
};
-module.exports.executeMount = (
- version,
- provider,
- remote,
- s3,
- location,
- exitCallback
-) => {
+module.exports.executeMount = (version, provider, remote, s3, location, exitCallback) => {
return new Promise((resolve) => {
const repertoryExec = _getRepertoryExec(version);
const processOptions = {
@@ -876,12 +846,7 @@ module.exports.getMissingDependencies = (dependencies) => {
} else {
for (const dep of dependencies) {
try {
- if (
- !(
- fs.lstatSync(dep.file).isFile() ||
- fs.lstatSync(dep.file).isSymbolicLink()
- )
- ) {
+ if (!(fs.lstatSync(dep.file).isFile() || fs.lstatSync(dep.file).isSymbolicLink())) {
missing.push(dep);
}
} catch (e) {
@@ -1037,10 +1002,7 @@ module.exports.importSkylinks = (version, jsonArray) => {
};
// https://stackoverflow.com/questions/31645738/how-to-create-full-path-with-nodes-fs-mkdirsync
-module.exports.mkDirByPathSync = (
- targetDir,
- { isRelativeToScript = false } = {}
-) => {
+module.exports.mkDirByPathSync = (targetDir, { isRelativeToScript = false } = {}) => {
const sep = path.sep;
const initDir = path.isAbsolute(targetDir) ? sep : '';
const baseDir = isRelativeToScript ? __dirname : '.';
@@ -1099,20 +1061,11 @@ module.exports.performWindowsUninstall = (names) => {
args2.push('REG_SZ');
_execProcessGetOutput(cmd, null, args2)
.then((lines) => {
- const value = lines[2]
- .trim()
- .substr(args2[3].length)
- .trim()
- .substr(6)
- .trim();
+ const value = lines[2].trim().substr(args2[3].length).trim().substr(6).trim();
if (names.includes(value)) {
const items = line.split('\\');
const productCode = items[items.length - 1];
- _executeProcess('msiexec.exe', null, [
- '/x',
- productCode,
- '/norestart',
- ])
+ _executeProcess('msiexec.exe', null, ['/x', productCode, '/norestart'])
.then((code) => {
if (code === 0 || code === 3010 || code === 1641) {
resolve(true);
@@ -1150,14 +1103,7 @@ module.exports.removeDirectoryRecursively = _removeDirectoryRecursively;
module.exports.resolvePath = _resolvePath;
-module.exports.setConfigValue = (
- name,
- value,
- provider,
- remote,
- s3,
- version
-) => {
+module.exports.setConfigValue = (name, value, provider, remote, s3, version) => {
return new Promise((resolve, reject) => {
const repertoryExec = _getRepertoryExec(version);
const processOptions = {
@@ -1290,15 +1236,7 @@ module.exports.verifySignature = (file, signatureFile, publicKeyFile) => {
const executeVerify = (openssl) => {
execFile(
openssl,
- [
- 'dgst',
- '-sha256',
- '-verify',
- publicKeyFile,
- '-signature',
- signatureFile,
- file,
- ],
+ ['dgst', '-sha256', '-verify', publicKeyFile, '-signature', signatureFile, file],
(err, stdout) => {
if (err) {
reject(err);
diff --git a/src/helpers.test.js b/src/helpers.test.js
index 197b2b9..6b547c8 100644
--- a/src/helpers.test.js
+++ b/src/helpers.test.js
@@ -31,10 +31,7 @@ test('create temp signature files', () => {
encoding: 'utf8',
})
.replace(/(\r\n|\n|\r)/gm, '');
- const data = helpers.createSignatureFiles(
- b64signature,
- Constants.DEV_PUBLIC_KEY
- );
+ const data = helpers.createSignatureFiles(b64signature, Constants.DEV_PUBLIC_KEY);
expect(data).toBeDefined();
expect(data.PublicKeyFile).toBeDefined();
expect(data.SignatureFile).toBeDefined();
diff --git a/src/index.js b/src/index.js
index a8e2af1..4012d58 100644
--- a/src/index.js
+++ b/src/index.js
@@ -44,9 +44,7 @@ if (ipcRenderer) {
}
store.dispatch(setProviderState(provider, state));
}
- store.dispatch(
- setActiveRelease(result.data.Release, result.data.Version)
- );
+ store.dispatch(setActiveRelease(result.data.Release, result.data.Version));
} else {
store = createAppStore(platformInfo, packageJson.version, {});
}
diff --git a/src/redux/actions/download_actions.js b/src/redux/actions/download_actions.js
index a5bfbdc..492d6a2 100644
--- a/src/redux/actions/download_actions.js
+++ b/src/redux/actions/download_actions.js
@@ -21,14 +21,7 @@ export const setDownloadBegin = (name, type, url) => {
export const setDownloadEnd = createAction('download/setDownloadEnd');
export const setDownloadProgress = createAction('download/setDownloadProgress');
-export const downloadItem = (
- name,
- type,
- urls,
- isWinFSP,
- testVersion,
- appPlatform
-) => {
+export const downloadItem = (name, type, urls, isWinFSP, testVersion, appPlatform) => {
return (dispatch, getState) => {
if (!Array.isArray(urls)) {
urls = [urls];
@@ -38,35 +31,20 @@ export const downloadItem = (
if (result.Success) {
switch (type) {
case Constants.INSTALL_TYPES.Dependency:
- dispatch(
- installDependency(result.Destination, result.URL, isWinFSP)
- );
+ dispatch(installDependency(result.Destination, result.URL, isWinFSP));
break;
case Constants.INSTALL_TYPES.Release:
dispatch(installRelease(result.Destination));
break;
case Constants.INSTALL_TYPES.TestRelease:
- dispatch(
- installAndTestRelease(
- result.Destination,
- testVersion,
- appPlatform
- )
- );
+ dispatch(installAndTestRelease(result.Destination, testVersion, appPlatform));
break;
case Constants.INSTALL_TYPES.Upgrade:
// const info =
// this.props.LocationsLookup[this.props.AppPlatform][this.props.VersionLookup[this.props.AppPlatform][0]];
//const sha256 = null; // info.sha256;
//const signature = null; // info.sig;
- dispatch(
- installUpgrade(
- result.Destination,
- null,
- null,
- !!result.SkipVerification
- )
- );
+ dispatch(installUpgrade(result.Destination, null, null, !!result.SkipVerification));
break;
default:
dispatch(notifyError('Unknown download type: ' + type));
@@ -83,10 +61,7 @@ export const downloadItem = (
const downloadAtIndex = (index) => {
const url = urls[index];
const state = getState();
- if (
- index > 0 ||
- (!state.download.DownloadActive && state.download.AllowDownload)
- ) {
+ if (index > 0 || (!state.download.DownloadActive && state.download.AllowDownload)) {
const ipcRenderer = getIPCRenderer();
if (ipcRenderer) {
dispatch(setDownloadBegin(name, type, url));
@@ -96,10 +71,7 @@ export const downloadItem = (
};
const downloadFileComplete = (_, arg) => {
- ipcRenderer.removeListener(
- Constants.IPC_Download_File_Progress,
- downloadFileProgress
- );
+ ipcRenderer.removeListener(Constants.IPC_Download_File_Progress, downloadFileProgress);
if (!arg.data.Success && ++index < urls.length) {
downloadAtIndex(index);
} else {
@@ -108,14 +80,8 @@ export const downloadItem = (
}
};
- ipcRenderer.on(
- Constants.IPC_Download_File_Progress,
- downloadFileProgress
- );
- ipcRenderer.once(
- Constants.IPC_Download_File_Complete,
- downloadFileComplete
- );
+ ipcRenderer.on(Constants.IPC_Download_File_Progress, downloadFileProgress);
+ ipcRenderer.once(Constants.IPC_Download_File_Complete, downloadFileComplete);
ipcRenderer.send(Constants.IPC_Download_File, {
Filename: name,
diff --git a/src/redux/actions/host_actions.js b/src/redux/actions/host_actions.js
index 41306ab..066f898 100644
--- a/src/redux/actions/host_actions.js
+++ b/src/redux/actions/host_actions.js
@@ -1,24 +1,24 @@
let addEditHostResolvers = [];
-export const addEditHost = (display, host_data, cb) => {
+export const addEditHost = (display, host_list, host_data, cb) => {
return (dispatch) => {
if (cb) {
- dispatch(addEditHost(display, host_data)).then(({ changed, host_data }) =>
+ dispatch(addEditHost(display, host_list, host_data)).then(({ changed, host_data }) =>
cb(changed, host_data)
);
} else {
return new Promise((resolve) => {
- dispatch(handleDisplayAddEditHost(display, host_data, resolve));
+ dispatch(handleDisplayAddEditHost(display, host_list, host_data, resolve));
});
}
};
};
-const handleDisplayAddEditHost = (display, host_data, resolve) => {
+const handleDisplayAddEditHost = (display, host_list, host_data, resolve) => {
return (dispatch) => {
if (display) {
addEditHostResolvers.push(resolve);
- dispatch(displayAddEditHost(display, host_data));
+ dispatch(displayAddEditHost(display, host_list, host_data));
} else {
dispatch(completeAddEditHost(false));
}
@@ -36,6 +36,6 @@ export const completeAddEditHost = (changed, host_data) => {
};
export const DISPLAY_ADD_EDIT_HOST = 'host/displayAddEditHost';
-export const displayAddEditHost = (display, host_data) => {
- return { type: DISPLAY_ADD_EDIT_HOST, payload: { display, host_data } };
+export const displayAddEditHost = (display, host_list, host_data) => {
+ return { type: DISPLAY_ADD_EDIT_HOST, payload: { display, host_data, host_list } };
};
diff --git a/src/redux/actions/install_actions.js b/src/redux/actions/install_actions.js
index 13842f4..4ce1f2b 100644
--- a/src/redux/actions/install_actions.js
+++ b/src/redux/actions/install_actions.js
@@ -31,8 +31,7 @@ export const checkInstalled = (dependencies, version) => {
const checkInstalledComplete = (_, arg) => {
const result = arg.data;
const updateState = () => {
- const installedVersion =
- result.Success && result.Exists ? result.Version : 'none';
+ const installedVersion = result.Success && result.Exists ? result.Version : 'none';
const state = getState();
const release = state.relver.Release;
@@ -41,8 +40,7 @@ export const checkInstalled = (dependencies, version) => {
let upgradeAvailable = false;
if (installedVersion !== 'none') {
const latestVersion =
- state.relver.VersionLookup[Constants.RELEASE_TYPES[release]]
- .length - 1;
+ state.relver.VersionLookup[Constants.RELEASE_TYPES[release]].length - 1;
if (version === -1) {
version = latestVersion;
dispatch(setActiveRelease(release, version));
@@ -63,14 +61,12 @@ export const checkInstalled = (dependencies, version) => {
dispatch(showWindow());
} else if (installedVersion === 'none' && autoInstallRelease) {
dispatch(setAllowMount(false));
- const versionString = getState().relver.VersionLookup[
- Constants.RELEASE_TYPES[release]
- ][version];
+ const versionString = getState().relver.VersionLookup[Constants.RELEASE_TYPES[release]][
+ version
+ ];
const urls = getState().relver.LocationsLookup[versionString].urls;
const fileName = versionString + '.zip';
- dispatch(
- downloadItem(fileName, Constants.INSTALL_TYPES.Release, urls)
- );
+ dispatch(downloadItem(fileName, Constants.INSTALL_TYPES.Release, urls));
}
};
@@ -81,10 +77,7 @@ export const checkInstalled = (dependencies, version) => {
}
};
- ipcRenderer.once(
- Constants.IPC_Check_Installed_Reply,
- checkInstalledComplete
- );
+ ipcRenderer.once(Constants.IPC_Check_Installed_Reply, checkInstalledComplete);
ipcRenderer.send(Constants.IPC_Check_Installed, {
Dependencies: dependencies,
Version: version,
@@ -104,8 +97,7 @@ export const checkVersionInstalled = () => {
state.relver.LocationsLookup[selectedVersion] &&
state.relver.LocationsLookup[selectedVersion].dependencies
) {
- dependencies =
- state.relver.LocationsLookup[selectedVersion].dependencies;
+ dependencies = state.relver.LocationsLookup[selectedVersion].dependencies;
}
dispatch(checkInstalled(dependencies, selectedVersion));
} else {
@@ -139,12 +131,9 @@ export const installDependency = (source, url, isWinFSP) => {
return d.download === url;
});
const i = setInterval(() => {
- const ret = ipcRenderer.sendSync(
- Constants.IPC_Check_Dependency_Installed + '_sync',
- {
- File: dep.file,
- }
- );
+ const ret = ipcRenderer.sendSync(Constants.IPC_Check_Dependency_Installed + '_sync', {
+ File: dep.file,
+ });
if (ret.data.Exists) {
clearInterval(i);
@@ -158,10 +147,7 @@ export const installDependency = (source, url, isWinFSP) => {
}
};
- ipcRenderer.once(
- Constants.IPC_Install_Dependency_Reply,
- installDependencyComplete
- );
+ ipcRenderer.once(Constants.IPC_Install_Dependency_Reply, installDependencyComplete);
ipcRenderer.send(Constants.IPC_Install_Dependency, {
Source: source,
URL: url,
@@ -199,10 +185,7 @@ export const installAndTestRelease = (source, version, appPlatform) => {
});
};
- ipcRenderer.once(
- Constants.IPC_Extract_Release_Complete,
- extractReleaseComplete
- );
+ ipcRenderer.once(Constants.IPC_Extract_Release_Complete, extractReleaseComplete);
ipcRenderer.send(Constants.IPC_Extract_Release, {
Source: source,
Version: version,
@@ -214,10 +197,7 @@ export const installAndTestRelease = (source, version, appPlatform) => {
export const installReleaseByVersion = (release, version) => {
return (dispatch, getState) => {
const install = () => {
- if (
- getState().download.AllowDownload &&
- !getState().download.DownloadActive
- ) {
+ if (getState().download.AllowDownload && !getState().download.DownloadActive) {
dispatch(setAutoInstallRelease(true));
dispatch(setActiveRelease(release, version));
} else {
@@ -251,10 +231,7 @@ export const installRelease = (source) => {
});
if (arg.data.Success) {
- localStorage.setItem(
- 'previous_releases',
- localStorage.getItem('releases')
- );
+ localStorage.setItem('previous_releases', localStorage.getItem('releases'));
dispatch(setNewReleasesAvailable2([]));
}
@@ -262,10 +239,7 @@ export const installRelease = (source) => {
dispatch(checkVersionInstalled());
};
- ipcRenderer.once(
- Constants.IPC_Extract_Release_Complete,
- extractReleaseComplete
- );
+ ipcRenderer.once(Constants.IPC_Extract_Release_Complete, extractReleaseComplete);
ipcRenderer.send(Constants.IPC_Extract_Release, {
Source: source,
Version: version,
@@ -303,10 +277,7 @@ export const installUpgrade = (source, sha256, signature, skipVerification) => {
}
};
- ipcRenderer.once(
- Constants.IPC_Install_Upgrade_Reply,
- installUpgradeComplete
- );
+ ipcRenderer.once(Constants.IPC_Install_Upgrade_Reply, installUpgradeComplete);
ipcRenderer.send(Constants.IPC_Install_Upgrade, {
Sha256: sha256,
Signature: signature,
@@ -317,17 +288,9 @@ export const installUpgrade = (source, sha256, signature, skipVerification) => {
};
};
-export const setAutoInstallRelease = createAction(
- 'install/setAutoInstallRelease'
-);
-export const setDismissDependencies = createAction(
- 'install/setDismissDependencies'
-);
+export const setAutoInstallRelease = createAction('install/setAutoInstallRelease');
+export const setDismissDependencies = createAction('install/setDismissDependencies');
export const setInstallActive = createAction('install/setInstallActive');
-export const setInstallTestActive = createAction(
- 'install/setInstallTestActive'
-);
+export const setInstallTestActive = createAction('install/setInstallTestActive');
export const setInstallComplete = createAction('install/setInstallComplete');
-export const setMissingDependencies = createAction(
- 'install/setMissingDependencies'
-);
+export const setMissingDependencies = createAction('install/setMissingDependencies');
diff --git a/src/redux/actions/mount_actions.js b/src/redux/actions/mount_actions.js
index 6a3fb7b..7912869 100644
--- a/src/redux/actions/mount_actions.js
+++ b/src/redux/actions/mount_actions.js
@@ -23,9 +23,7 @@ export const addRemoteMount = (hostNameOrIp, port, token) => {
Version: getState().relver.InstalledVersion,
});
} else {
- dispatch(
- notifyError('Failed to create S3 instance: ' + arg.data.Error)
- );
+ dispatch(notifyError('Failed to create S3 instance: ' + arg.data.Error));
dispatch(setBusy(false));
}
});
@@ -44,14 +42,7 @@ export const addRemoteMount = (hostNameOrIp, port, token) => {
};
};
-export const addS3Mount = (
- name,
- accessKey,
- secretKey,
- region,
- bucketName,
- url
-) => {
+export const addS3Mount = (name, accessKey, secretKey, region, bucketName, url) => {
return (dispatch, getState) => {
const ipcRenderer = getIPCRenderer();
const provider = 'S3' + name;
@@ -67,9 +58,7 @@ export const addS3Mount = (
Version: getState().relver.InstalledVersion,
});
} else {
- dispatch(
- notifyError('Failed to create S3 instance: ' + arg.data.Error)
- );
+ dispatch(notifyError('Failed to create S3 instance: ' + arg.data.Error));
dispatch(setBusy(false));
}
});
@@ -107,13 +96,13 @@ export const displayConfiguration = (provider, remote, s3) => {
export const removeMount = (provider) => {
return (dispatch) => {
const isRemote = provider.startsWith('Remote');
- dispatch(
- confirmYesNo('Delete [' + provider.substr(isRemote ? 6 : 2) + ']?')
- ).then((confirmed) => {
- if (confirmed) {
- dispatch(removeMount2(provider));
+ dispatch(confirmYesNo('Delete [' + provider.substr(isRemote ? 6 : 2) + ']?')).then(
+ (confirmed) => {
+ if (confirmed) {
+ dispatch(removeMount2(provider));
+ }
}
- });
+ );
};
};
diff --git a/src/redux/actions/release_version_actions.js b/src/redux/actions/release_version_actions.js
index 96e04e2..912290a 100644
--- a/src/redux/actions/release_version_actions.js
+++ b/src/redux/actions/release_version_actions.js
@@ -9,17 +9,9 @@ import {
getSelectedVersionFromState,
} from '../../utils.jsx';
-import {
- saveState,
- setAllowMount,
- setApplicationReady,
- showWindow,
-} from './common_actions';
+import { saveState, setAllowMount, setApplicationReady, showWindow } from './common_actions';
import { notifyError } from './error_actions';
-import {
- checkVersionInstalled,
- setDismissDependencies,
-} from './install_actions';
+import { checkVersionInstalled, setDismissDependencies } from './install_actions';
import { unmountAll } from './mount_actions';
export const CLEAR_UI_UPGRADE = 'relver/clearUIUpgrade';
@@ -85,19 +77,12 @@ export const loadReleases = () => {
release = Constants.DEFAULT_RELEASE;
}
- let latestVersion =
- versionLookup[Constants.RELEASE_TYPES[release]].length - 1;
+ let latestVersion = versionLookup[Constants.RELEASE_TYPES[release]].length - 1;
let version = state.Version;
- if (
- versionLookup[Constants.RELEASE_TYPES[release]][0] === 'unavailable'
- ) {
+ if (versionLookup[Constants.RELEASE_TYPES[release]][0] === 'unavailable') {
release = Constants.DEFAULT_RELEASE;
- version = latestVersion =
- versionLookup[Constants.RELEASE_TYPES[release]].length - 1;
- } else if (
- version === -1 ||
- !versionLookup[Constants.RELEASE_TYPES[release]][version]
- ) {
+ version = latestVersion = versionLookup[Constants.RELEASE_TYPES[release]].length - 1;
+ } else if (version === -1 || !versionLookup[Constants.RELEASE_TYPES[release]][version]) {
version = latestVersion;
}
@@ -109,9 +94,7 @@ export const loadReleases = () => {
dispatch(detectUIUpgrade());
if (processAllowDismiss) {
dispatch(
- setAllowDismissDependencies(
- versionLookup[Constants.RELEASE_TYPES[release]].length > 1
- )
+ setAllowDismissDependencies(versionLookup[Constants.RELEASE_TYPES[release]].length > 1)
);
}
dispatch(checkVersionInstalled());
@@ -176,9 +159,7 @@ export const loadReleases = () => {
localStorage.setItem('previous_releases', storedReleases);
dispatch(showWindow());
} else if (
- (newReleases = checkNewReleases(
- getSelectedVersionFromState(getState())
- )).length > 0
+ (newReleases = checkNewReleases(getSelectedVersionFromState(getState()))).length > 0
) {
dispatch(setNewReleasesAvailable2(newReleases));
}
@@ -225,20 +206,12 @@ export const setActiveRelease = (release, version) => {
};
};
-export const setAllowDismissDependencies = createAction(
- 'relver/setAllowDismissDependencies'
-);
-export const setDismissNewReleasesAvailable = createAction(
- 'relver/setDismissNewReleasesAvailable'
-);
+export const setAllowDismissDependencies = createAction('relver/setAllowDismissDependencies');
+export const setDismissNewReleasesAvailable = createAction('relver/setDismissNewReleasesAvailable');
export const setDismissUIUpgrade = createAction('relver/setDismissUIUpgrade');
export const setInstalledVersion = createAction('relver/setInstalledVersion');
-export const setNewReleasesAvailable = createAction(
- 'relver/setNewReleasesAvailable'
-);
-export const setNewReleasesAvailable2 = createAction(
- 'relver/setNewReleasesAvailable2'
-);
+export const setNewReleasesAvailable = createAction('relver/setNewReleasesAvailable');
+export const setNewReleasesAvailable2 = createAction('relver/setNewReleasesAvailable2');
export const SET_RELEASE_DATA = 'relver/setReleaseData';
export const setReleaseData = (locationsLookup, versionLookup) => {
@@ -251,9 +224,7 @@ export const setReleaseData = (locationsLookup, versionLookup) => {
};
};
-export const setReleaseUpgradeAvailable = createAction(
- 'relver/setReleaseUpgradeAvailable'
-);
+export const setReleaseUpgradeAvailable = createAction('relver/setReleaseUpgradeAvailable');
export const SET_UI_UPGRADE_DATA = 'relver/setUIUpgradeData';
export const setUIUpgradeData = (upgradeData, version) => {
diff --git a/src/redux/reducers/error_reducer.js b/src/redux/reducers/error_reducer.js
index 180ea64..15cd243 100644
--- a/src/redux/reducers/error_reducer.js
+++ b/src/redux/reducers/error_reducer.js
@@ -1,10 +1,5 @@
import { createReducer } from '@reduxjs/toolkit';
-import {
- CLEAR_ERROR,
- CLEAR_INFO,
- SET_ERROR_INFO,
- SET_INFO,
-} from '../actions/error_actions';
+import { CLEAR_ERROR, CLEAR_INFO, SET_ERROR_INFO, SET_INFO } from '../actions/error_actions';
export const errorReducer = createReducer(
{
@@ -16,8 +11,7 @@ export const errorReducer = createReducer(
},
{
[CLEAR_ERROR]: (state) => {
- const errorStack =
- state.ErrorStack.length > 0 ? state.ErrorStack.slice(1) : [];
+ const errorStack = state.ErrorStack.length > 0 ? state.ErrorStack.slice(1) : [];
return {
...state,
DisplayError: errorStack.length > 0,
@@ -25,8 +19,7 @@ export const errorReducer = createReducer(
};
},
[CLEAR_INFO]: (state) => {
- const infoStack =
- state.InfoStack.length > 0 ? state.InfoStack.slice(1) : [];
+ const infoStack = state.InfoStack.length > 0 ? state.InfoStack.slice(1) : [];
return {
...state,
DisplayInfo: infoStack.length > 0,
diff --git a/src/redux/reducers/mount_reducer.js b/src/redux/reducers/mount_reducer.js
index 0f71cb6..e96bec2 100644
--- a/src/redux/reducers/mount_reducer.js
+++ b/src/redux/reducers/mount_reducer.js
@@ -140,9 +140,7 @@ export const createMountReducer = (state) => {
let autoMountProcessed = { ...state.AutoMountProcessed };
delete autoMountProcessed[action.payload];
- const remoteMounts = state.RemoteMounts.filter(
- (i) => i !== action.payload
- );
+ const remoteMounts = state.RemoteMounts.filter((i) => i !== action.payload);
const s3Mounts = state.S3Mounts.filter((i) => i !== action.payload);
return {
...state,
diff --git a/src/renderer/ipc/ConfigIPC.js b/src/renderer/ipc/ConfigIPC.js
index 5b0028e..772fdbb 100644
--- a/src/renderer/ipc/ConfigIPC.js
+++ b/src/renderer/ipc/ConfigIPC.js
@@ -11,12 +11,7 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
Config: data.Data,
});
} else {
- standardIPCReply(
- event,
- Constants.IPC_Get_Config_Reply,
- {},
- data.Code
- );
+ standardIPCReply(event, Constants.IPC_Get_Config_Reply, {}, data.Code);
}
})
.catch((error) => {
@@ -33,12 +28,7 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
});
})
.catch((error) => {
- standardIPCReply(
- event,
- Constants.IPC_Get_Config_Template_Reply,
- {},
- error
- );
+ standardIPCReply(event, Constants.IPC_Get_Config_Template_Reply, {}, error);
});
});
@@ -58,12 +48,7 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
setConfigValue(++i);
})
.catch((error) => {
- standardIPCReply(
- event,
- Constants.IPC_Set_Config_Values_Reply,
- {},
- error
- );
+ standardIPCReply(event, Constants.IPC_Set_Config_Values_Reply, {}, error);
});
} else {
standardIPCReply(event, Constants.IPC_Set_Config_Values_Reply, {});
diff --git a/src/renderer/ipc/DependencyIPC.js b/src/renderer/ipc/DependencyIPC.js
index 7580e57..5c60718 100644
--- a/src/renderer/ipc/DependencyIPC.js
+++ b/src/renderer/ipc/DependencyIPC.js
@@ -20,23 +20,20 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
}
});
- ipcMain.on(
- Constants.IPC_Check_Dependency_Installed + '_sync',
- (event, data) => {
- try {
- const ls = fs.lstatSync(data.File);
- event.returnValue = {
- data: {
- Exists: ls.isFile() || ls.isSymbolicLink(),
- },
- };
- } catch (e) {
- event.returnValue = {
- data: { Exists: false },
- };
- }
+ ipcMain.on(Constants.IPC_Check_Dependency_Installed + '_sync', (event, data) => {
+ try {
+ const ls = fs.lstatSync(data.File);
+ event.returnValue = {
+ data: {
+ Exists: ls.isFile() || ls.isSymbolicLink(),
+ },
+ };
+ } catch (e) {
+ event.returnValue = {
+ data: { Exists: false },
+ };
}
- );
+ });
ipcMain.on(Constants.IPC_Install_Dependency, (event, data) => {
if (data.Source.toLowerCase().endsWith('.dmg')) {
diff --git a/src/renderer/ipc/MountsIPC.js b/src/renderer/ipc/MountsIPC.js
index bee5487..bedd695 100644
--- a/src/renderer/ipc/MountsIPC.js
+++ b/src/renderer/ipc/MountsIPC.js
@@ -17,14 +17,7 @@ const clearManualMountDetection = (provider) => {
}
};
-const monitorMount = (
- sender,
- provider,
- providerList,
- version,
- pid,
- location
-) => {
+const monitorMount = (sender, provider, providerList, version, pid, location) => {
manualMountDetection[provider] = setInterval(() => {
helpers
.detectRepertoryMounts(version, providerList)
@@ -62,12 +55,7 @@ const unmountAllDrives = () => {
// Unmount all items
for (const mountLocation of mountedLocations) {
const data = mountedData[mountLocation];
- helpers.stopMountProcessSync(
- data.Version,
- data.Provider,
- data.Remote,
- data.S3
- );
+ helpers.stopMountProcessSync(data.Version, data.Provider, data.Remote, data.S3);
}
mountedLocations = [];
@@ -79,10 +67,7 @@ const addListeners = (ipcMain, { setTrayImage, standardIPCReply }) => {
let response = { Success: true, Error: '' };
try {
- if (
- fs.existsSync(data.Location) &&
- fs.statSync(data.Location).isDirectory()
- ) {
+ if (fs.existsSync(data.Location) && fs.statSync(data.Location).isDirectory()) {
if (fs.readdirSync(data.Location).length !== 0) {
response.Success = false;
response.Error = 'Directory not empty: ' + data.Location;
@@ -102,11 +87,7 @@ const addListeners = (ipcMain, { setTrayImage, standardIPCReply }) => {
const provider = data.Provider;
let driveLetters = {};
- const providerList = [
- ...Constants.PROVIDER_LIST,
- ...data.RemoteMounts,
- ...data.S3Mounts,
- ];
+ const providerList = [...Constants.PROVIDER_LIST, ...data.RemoteMounts, ...data.S3Mounts];
for (const provider of providerList) {
driveLetters[provider] = [];
}
@@ -283,12 +264,7 @@ const addListeners = (ipcMain, { setTrayImage, standardIPCReply }) => {
data.Name = data.Name.replace(':', '_');
}
const dataDirectory = path.resolve(
- path.join(
- helpers.getDataDirectory(),
- '..',
- data.Remote ? 'remote' : 's3',
- data.Name
- )
+ path.join(helpers.getDataDirectory(), '..', data.Remote ? 'remote' : 's3', data.Name)
);
try {
diff --git a/src/renderer/ipc/PinnedIPC.js b/src/renderer/ipc/PinnedIPC.js
index cd25c63..d3bce3b 100644
--- a/src/renderer/ipc/PinnedIPC.js
+++ b/src/renderer/ipc/PinnedIPC.js
@@ -4,13 +4,7 @@ const helpers = require('../../helpers');
const addListeners = (ipcMain, { standardIPCReply }) => {
ipcMain.on(Constants.IPC_Get_Directory_Items, (event, data) => {
helpers
- .grabDirectoryItems(
- data.Path,
- data.Version,
- data.Provider,
- data.Remote,
- data.S3
- )
+ .grabDirectoryItems(data.Path, data.Version, data.Provider, data.Remote, data.S3)
.then((data) => {
standardIPCReply(event, Constants.IPC_Get_Directory_Items_Reply, {
Items: data.items,
@@ -23,13 +17,7 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
ipcMain.on(Constants.IPC_Get_Pinned_Files, (event, data) => {
helpers
- .grabDirectoryItems(
- data.Path,
- data.Version,
- data.Provider,
- data.Remote,
- data.S3
- )
+ .grabDirectoryItems(data.Path, data.Version, data.Provider, data.Remote, data.S3)
.then((data) => {
standardIPCReply(event, Constants.IPC_Get_Directory_Items_Reply, {
Items: data.items,
@@ -44,14 +32,7 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
ipcMain.on(Constants.IPC_Set_Pinned + '_sync', (event, data) => {
helpers
- .setPinned(
- data.Path,
- data.Pinned,
- data.Version,
- data.Provider,
- data.Remote,
- data.S3
- )
+ .setPinned(data.Path, data.Pinned, data.Version, data.Provider, data.Remote, data.S3)
.then((success) => {
event.returnValue = success;
})
diff --git a/src/renderer/ipc/PlatformIPC.js b/src/renderer/ipc/PlatformIPC.js
index 570d055..9501d08 100644
--- a/src/renderer/ipc/PlatformIPC.js
+++ b/src/renderer/ipc/PlatformIPC.js
@@ -36,26 +36,21 @@ const addListeners = (ipcMain, { detectScript, saveUiSettings }) => {
.then((data) => {
let appPlatform = data.replace(/(\r\n|\n|\r)/gm, '');
if (appPlatform === 'unknown') {
- helpers.downloadFile(
- Constants.LINUX_DETECT_SCRIPT_URL,
- scriptFile,
- null,
- (err) => {
- if (err) {
- sendResponse(appPlatform, platform);
- } else {
- helpers
- .executeScript(scriptFile)
- .then((data) => {
- appPlatform = data.replace(/(\r\n|\n|\r)/gm, '');
- sendResponse(appPlatform, platform);
- })
- .catch(() => {
- sendResponse(appPlatform, platform);
- });
- }
+ helpers.downloadFile(Constants.LINUX_DETECT_SCRIPT_URL, scriptFile, null, (err) => {
+ if (err) {
+ sendResponse(appPlatform, platform);
+ } else {
+ helpers
+ .executeScript(scriptFile)
+ .then((data) => {
+ appPlatform = data.replace(/(\r\n|\n|\r)/gm, '');
+ sendResponse(appPlatform, platform);
+ })
+ .catch(() => {
+ sendResponse(appPlatform, platform);
+ });
}
- );
+ });
} else {
sendResponse(appPlatform, platform);
}
diff --git a/src/renderer/ipc/ReleaseIPC.js b/src/renderer/ipc/ReleaseIPC.js
index 50a75bf..017907b 100644
--- a/src/renderer/ipc/ReleaseIPC.js
+++ b/src/renderer/ipc/ReleaseIPC.js
@@ -13,9 +13,7 @@ const addListeners = (ipcMain, { getCleanupReleases, standardIPCReply }) => {
.then((dependencies) => {
let exists = false;
try {
- exists =
- fs.existsSync(destination) &&
- fs.lstatSync(destination).isDirectory();
+ exists = fs.existsSync(destination) && fs.lstatSync(destination).isDirectory();
} catch (e) {}
standardIPCReply(event, Constants.IPC_Check_Installed_Reply, {
Dependencies: dependencies,
@@ -70,9 +68,7 @@ const addListeners = (ipcMain, { getCleanupReleases, standardIPCReply }) => {
stream.close();
if (os.platform() !== 'win32') {
helpers
- .executeAndWait(
- 'chmod +x "' + path.join(destination, 'repertory') + '"'
- )
+ .executeAndWait('chmod +x "' + path.join(destination, 'repertory') + '"')
.then(() => {
standardIPCReply(event, Constants.IPC_Extract_Release_Complete, {
Source: data.Source,
diff --git a/src/renderer/ipc/SkynetIPC.js b/src/renderer/ipc/SkynetIPC.js
index c1c344b..22c9794 100644
--- a/src/renderer/ipc/SkynetIPC.js
+++ b/src/renderer/ipc/SkynetIPC.js
@@ -24,12 +24,7 @@ const addListeners = (ipcMain, { standardIPCReply }) => {
});
})
.catch((error) => {
- standardIPCReply(
- event,
- Constants.IPC_Grab_Skynet_Tree_Reply,
- {},
- error
- );
+ standardIPCReply(event, Constants.IPC_Grab_Skynet_Tree_Reply, {}, error);
});
});
diff --git a/src/renderer/ipc/StateIPC.js b/src/renderer/ipc/StateIPC.js
index ef26170..e760cae 100644
--- a/src/renderer/ipc/StateIPC.js
+++ b/src/renderer/ipc/StateIPC.js
@@ -40,9 +40,7 @@ const addListeners = (ipcMain) => {
data.RemoteMounts = data.RemoteMounts || [];
data.S3Mounts = data.S3Mounts || [];
- const remoteItems = getDirectories(
- path.join(helpers.getRepertoryDirectory(), 'remote')
- );
+ const remoteItems = getDirectories(path.join(helpers.getRepertoryDirectory(), 'remote'));
for (const dir of remoteItems) {
const name = 'Remote' + dir.replace('_', ':');
if (!data.RemoteMounts || data.RemoteMounts.indexOf(name) === -1) {
@@ -55,9 +53,7 @@ const addListeners = (ipcMain) => {
}
}
- const s3Items = getDirectories(
- path.join(helpers.getRepertoryDirectory(), 's3')
- );
+ const s3Items = getDirectories(path.join(helpers.getRepertoryDirectory(), 's3'));
for (const dir of s3Items) {
const name = 'S3' + dir;
if (!data.S3Mounts || data.S3Mounts.indexOf(name) === -1) {
diff --git a/src/renderer/ipc/UpgradeIPC.js b/src/renderer/ipc/UpgradeIPC.js
index 0a4cbc4..8fdceac 100644
--- a/src/renderer/ipc/UpgradeIPC.js
+++ b/src/renderer/ipc/UpgradeIPC.js
@@ -3,10 +3,7 @@ const fs = require('fs');
const helpers = require('../../helpers');
const os = require('os');
-const addListeners = (
- ipcMain,
- { setIsInstalling, unmountAllDrives, standardIPCReply }
-) => {
+const addListeners = (ipcMain, { setIsInstalling, unmountAllDrives, standardIPCReply }) => {
ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
let allowSkipVerification = true;
@@ -46,10 +43,7 @@ const addListeners = (
//! (data.Sha256.length > 0);
if (hasSignature) {
try {
- const files = helpers.createSignatureFiles(
- data.Signature,
- Constants.DEV_PUBLIC_KEY
- );
+ const files = helpers.createSignatureFiles(data.Signature, Constants.DEV_PUBLIC_KEY);
tempPub = files.PublicKeyFile;
tempSig = files.SignatureFile;
} catch (e) {
@@ -99,9 +93,7 @@ const addListeners = (
executeInstall();
})
.catch(() => {
- errorHandler(
- Error('Failed to verify installation package signature')
- );
+ errorHandler(Error('Failed to verify installation package signature'));
});
} else if (hasHash) {
helpers
diff --git a/src/serviceWorker.js b/src/serviceWorker.js
index 1b6d4f8..7e472c4 100644
--- a/src/serviceWorker.js
+++ b/src/serviceWorker.js
@@ -15,9 +15,7 @@ const isLocalhost = Boolean(
// [::1] is the IPv6 localhost address.
window.location.hostname === '[::1]' ||
// 127.0.0.1/8 is considered localhost for IPv4.
- window.location.hostname.match(
- /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
- )
+ window.location.hostname.match(/^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/)
);
export function register(config) {
@@ -120,9 +118,7 @@ function checkValidServiceWorker(swUrl, config) {
}
})
.catch(() => {
- console.log(
- 'No internet connection found. App is running in offline mode.'
- );
+ console.log('No internet connection found. App is running in offline mode.');
});
}
diff --git a/src/utils.jsx b/src/utils.jsx
index 7564810..4811d4c 100644
--- a/src/utils.jsx
+++ b/src/utils.jsx
@@ -100,9 +100,7 @@ export const getChangesForRepertoryVersion = (version) => {
return (
!ended &&
l.length > 0 &&
- (found
- ? !(ended = l.startsWith('## '))
- : (found = l.startsWith(`## ${version}`)))
+ (found ? !(ended = l.startsWith('## ')) : (found = l.startsWith(`## ${version}`)))
);
});
resolve(lines);
@@ -120,11 +118,7 @@ export const getIPCRenderer = () => {
return ipcRenderer;
};
-export const getNewReleases = (
- existingLocations,
- newLocations,
- selectedVersion
-) => {
+export const getNewReleases = (existingLocations, newLocations, selectedVersion) => {
const ret = [];
if (existingLocations && newLocations) {
Constants.RELEASE_TYPES.forEach((release) => {