[Antergos and Manjaro support] [Download latest detect_linux.sh if bundled script returns unknown] [Display error message if OS is detected as unknown]
This commit is contained in:
@@ -1,4 +1,12 @@
|
||||
# Changelog #
|
||||
|
||||
## 1.0.6 ##
|
||||
* Additional Linux distribution support:
|
||||
* Antergos
|
||||
* Manjaro
|
||||
* Download latest `detect_linux.sh` if bundled script returns `unknown`
|
||||
* Display error message if OS is detected as `unknown`
|
||||
|
||||
## 1.0.5 ##
|
||||
* \#29: Mounts aren't being detected properly when switching releases
|
||||
* Display window when dependencies are missing
|
||||
|
||||
10
README.md
10
README.md
@@ -9,15 +9,17 @@ Repertory allows you to mount Sia and/or SiaPrime blockchain storage solutions v
|
||||
* SiaPrime >=1.4.0
|
||||
|
||||
## Downloads ##
|
||||
* **Repertory UI v1.0.5 Linux 64-bit** [<Primary\>](https://pixeldrain.com/u/ZqKqdZq7) [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.5_linux_x86_64.AppImage)
|
||||
* **Repertory UI v1.0.6 Linux 64-bit** [<Primary\>]() [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.6_linux_x86_64.AppImage)
|
||||
* NOTE: Linux distributions require `fuse` and `libfuse` to be installed.
|
||||
* **Repertory UI v1.0.5 OS X 64-bit** [<Primary\>](https://pixeldrain.com/u/h5vrCdcf) [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.5_mac.dmg)
|
||||
* **Repertory UI v1.0.5 Windows 64-bit** [<Primary\>](https://pixeldrain.com/u/q0yXuEPl) [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.5_win.exe)
|
||||
* **Repertory UI v1.0.6 OS X 64-bit** [<Primary\>]() [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.6_mac.dmg)
|
||||
* **Repertory UI v1.0.6 Windows 64-bit** [<Primary\>]() [<Alternate\>](https://bitbucket.org/blockstorage/repertory-ui/downloads/repertory-ui_1.0.6_win.exe)
|
||||
|
||||
## Supported Platforms ##
|
||||
* OS X 64-bit
|
||||
* Windows 64-bit
|
||||
* Linux 64-bit Distributions:
|
||||
* Antergos
|
||||
* Uses `Ubuntu 18.10` binaries for compatibility
|
||||
* Arch Linux
|
||||
* Bodhi 5.0.0
|
||||
* CentOS 7
|
||||
@@ -29,6 +31,8 @@ Repertory allows you to mount Sia and/or SiaPrime blockchain storage solutions v
|
||||
* Fedora 30
|
||||
* Linux Mint 19
|
||||
* Linux Mint 19.1
|
||||
* Manjaro
|
||||
* Uses `Ubuntu 18.10` binaries for compatibility
|
||||
* OpenSUSE Leap 15.0
|
||||
* OpenSUSE Leap 15.1
|
||||
* OpenSUSE Tumbleweed
|
||||
|
||||
@@ -67,6 +67,9 @@ elif [ -f /etc/os-release ]; then
|
||||
. /etc/os-release
|
||||
if [ "$ID" == "arch" ]; then
|
||||
DISTNAME=arch
|
||||
elif [ "$ID" == "antergos" ] || [ "$ID" == "manjaro" ]; then
|
||||
DISTNAME=ubuntu
|
||||
DISTVER=18.10
|
||||
elif [ "$ID" == "opensuse-leap" ]; then
|
||||
if [ "$VERSION_ID" == "15.0" ]; then
|
||||
DISTNAME=opensuse
|
||||
|
||||
@@ -650,29 +650,48 @@ ipcMain.on(Constants.IPC_Get_Config_Template, (event, data) => {
|
||||
});
|
||||
|
||||
ipcMain.on(Constants.IPC_Get_Platform, (event) => {
|
||||
const sendResponse = (appPlatform, platform) => {
|
||||
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
||||
AppPlatform: appPlatform,
|
||||
Platform: platform,
|
||||
});
|
||||
};
|
||||
|
||||
const platform = os.platform();
|
||||
if (platform === 'linux') {
|
||||
const scriptFile = path.join(os.tmpdir(), 'repertory_detect_linux.sh');
|
||||
fs.writeFileSync(scriptFile, detectScript);
|
||||
|
||||
helpers
|
||||
.executeScript(scriptFile)
|
||||
.then(data => {
|
||||
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
||||
AppPlatform: data.replace(/(\r\n|\n|\r)/gm,""),
|
||||
Platform: platform,
|
||||
});
|
||||
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);
|
||||
});
|
||||
}
|
||||
});
|
||||
} else {
|
||||
sendResponse(appPlatform, platform);
|
||||
}
|
||||
})
|
||||
.catch(() => {
|
||||
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
||||
AppPlatform: platform,
|
||||
Platform: platform,
|
||||
});
|
||||
sendResponse(platform, platform);
|
||||
});
|
||||
} else {
|
||||
event.sender.send(Constants.IPC_Get_Platform_Reply, {
|
||||
AppPlatform: platform,
|
||||
Platform: platform,
|
||||
});
|
||||
sendResponse(platform, platform);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
10
src/App.js
10
src/App.js
@@ -2,6 +2,7 @@ import React from 'react';
|
||||
import './App.css';
|
||||
import Box from './components/UI/Box/Box';
|
||||
import Configuration from './containers/Configuration/Configuration';
|
||||
import {checkVersionInstalled} from './redux/actions/install_actions';
|
||||
import {connect} from 'react-redux';
|
||||
import DependencyList from './components/DependencyList/DependencyList';
|
||||
import DownloadProgress from './components/DownloadProgress/DownloadProgress';
|
||||
@@ -11,16 +12,16 @@ import IPCContainer from './containers/IPCContainer/IPCContainer';
|
||||
import Loading from './components/UI/Loading/Loading';
|
||||
import Modal from './components/UI/Modal/Modal';
|
||||
import MountItems from './containers/MountItems/MountItems';
|
||||
import {notifyError} from './redux/actions/error_actions';
|
||||
import ReleaseVersionDisplay from './components/ReleaseVersionDisplay/ReleaseVersionDisplay';
|
||||
import {saveState} from './redux/actions/common_actions';
|
||||
import Text from './components/UI/Text/Text';
|
||||
import UpgradeIcon from './components/UpgradeIcon/UpgradeIcon';
|
||||
import UpgradeUI from './components/UpgradeUI/UpgradeUI';
|
||||
import {checkVersionInstalled} from './redux/actions/install_actions';
|
||||
import {
|
||||
loadReleases,
|
||||
setDismissUIUpgrade
|
||||
} from './redux/actions/release_version_actions';
|
||||
import {saveState} from './redux/actions/common_actions';
|
||||
|
||||
const Constants = require('./constants');
|
||||
const Scheduler = require('node-schedule');
|
||||
@@ -28,7 +29,9 @@ const Scheduler = require('node-schedule');
|
||||
class App extends IPCContainer {
|
||||
componentDidMount() {
|
||||
const detectUpgrades = () => {
|
||||
if (this.props.AppPlatform !== 'unknown') {
|
||||
if (this.props.AppPlatform === 'unknown') {
|
||||
this.props.notifyError('Operation system is not supported.', true);
|
||||
} else {
|
||||
this.props.loadReleases();
|
||||
}
|
||||
};
|
||||
@@ -199,6 +202,7 @@ const mapDispatchToProps = dispatch => {
|
||||
return {
|
||||
checkVersionInstalled: () => dispatch(checkVersionInstalled()),
|
||||
loadReleases: ()=> dispatch(loadReleases()),
|
||||
notifyError: (msg, critical, callback) => dispatch(notifyError(msg, critical, callback)),
|
||||
saveState: () => dispatch(saveState()),
|
||||
setDismissUIUpgrade: dismiss => dispatch(setDismissUIUpgrade(dismiss)),
|
||||
};
|
||||
|
||||
@@ -27,8 +27,14 @@ exports.DEV_PUBLIC_KEY = '-----BEGIN PUBLIC KEY-----\n' +
|
||||
'9wIDAQAB\n' +
|
||||
'-----END PUBLIC KEY-----';
|
||||
|
||||
exports.RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory/raw/1.0.0-release_branch/releases.json';
|
||||
exports.UI_RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory-ui/raw/1.0.6_branch/releases.json';
|
||||
|
||||
const REPERTORY_BRANCH = '1.0.1-release_branch';
|
||||
const REPERTORY_UI_BRANCH = '1.0.6_branch';
|
||||
|
||||
exports.RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory/raw/' + REPERTORY_BRANCH + '/releases.json';
|
||||
exports.UI_RELEASES_URL = 'https://bitbucket.org/blockstorage/repertory-ui/raw/' + REPERTORY_UI_BRANCH + '/releases.json';
|
||||
|
||||
exports.LINUX_DETECT_SCRIPT_URL = 'https://bitbucket.org/blockstorage/repertory/raw/' + REPERTORY_BRANCH + '/detect_linux.sh';
|
||||
|
||||
exports.DATA_LOCATIONS = {
|
||||
linux: '~/.local/repertory/ui',
|
||||
|
||||
@@ -140,7 +140,9 @@ module.exports.downloadFile = (url, destination, progressCallback, completeCallb
|
||||
response.data.on('data', (chunk) => {
|
||||
stream.write(Buffer.from(chunk));
|
||||
downloaded += chunk.length;
|
||||
progressCallback((downloaded / total * 100.0).toFixed(2));
|
||||
if (progressCallback) {
|
||||
progressCallback((downloaded / total * 100.0).toFixed(2));
|
||||
}
|
||||
});
|
||||
|
||||
response.data.on('end', () => {
|
||||
|
||||
Reference in New Issue
Block a user