\#28: Fix Linux upgrade
This commit is contained in:
@@ -1,5 +1,6 @@
|
|||||||
# Changelog #
|
# Changelog #
|
||||||
## 1.0.4 ##
|
## 1.0.4 ##
|
||||||
|
* \#28: Fix Linux upgrade
|
||||||
* Additional Linux distribution support:
|
* Additional Linux distribution support:
|
||||||
* OpenSUSE Leap 15
|
* OpenSUSE Leap 15
|
||||||
* OpenSUSE Leap 15.1
|
* OpenSUSE Leap 15.1
|
||||||
|
|||||||
@@ -16,7 +16,6 @@ require.extensions['.sh'] = function (module, filename) {
|
|||||||
module.exports = fs.readFileSync(filename, 'utf8');
|
module.exports = fs.readFileSync(filename, 'utf8');
|
||||||
};
|
};
|
||||||
const detectScript = require('./detect_linux.sh');
|
const detectScript = require('./detect_linux.sh');
|
||||||
const installScript = require('./update_linux.sh');
|
|
||||||
|
|
||||||
// Keep a global reference of the window object, if you don't, the window will
|
// Keep a global reference of the window object, if you don't, the window will
|
||||||
// be closed automatically when the JavaScript object is garbage collected.
|
// be closed automatically when the JavaScript object is garbage collected.
|
||||||
@@ -747,11 +746,8 @@ ipcMain.on(Constants.IPC_Install_Upgrade, (event, data) => {
|
|||||||
args = ['-a', 'Finder', data.Source];
|
args = ['-a', 'Finder', data.Source];
|
||||||
} else if (platform === 'linux') {
|
} else if (platform === 'linux') {
|
||||||
try {
|
try {
|
||||||
const execPath = path.join(os.tmpdir(), 'install_linux.sh');
|
command = data.Source;
|
||||||
fs.writeFileSync(execPath, installScript);
|
fs.chmodSync(command, '750');
|
||||||
fs.chmodSync(execPath, '750');
|
|
||||||
command = execPath;
|
|
||||||
args = [data.Source];
|
|
||||||
} catch (e) {
|
} catch (e) {
|
||||||
errorHandler(e);
|
errorHandler(e);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,8 +0,0 @@
|
|||||||
#!/bin/sh
|
|
||||||
|
|
||||||
sleep 5
|
|
||||||
chmod +x "$1"
|
|
||||||
"$1"&
|
|
||||||
|
|
||||||
sleep 1
|
|
||||||
rm -f "$0"
|
|
||||||
10
src/App.js
10
src/App.js
@@ -113,9 +113,12 @@ class App extends IPCContainer {
|
|||||||
};
|
};
|
||||||
|
|
||||||
handleDownloadUpgrade = () => {
|
handleDownloadUpgrade = () => {
|
||||||
const url = this.props.UpgradeData.urls[0];
|
const name = (this.props.Platform === 'win32') ?
|
||||||
const name = this.props.Platform === 'win32' ? 'upgrade.exe' : this.props.Platform === 'darwin' ? 'upgrade.dmg' : extractFileNameFromURL(url);
|
'upgrade.exe' :
|
||||||
this.props.downloadItem(name, Constants.INSTALL_TYPES.Upgrade, url, this.onDownloadFileComplete);
|
(this.props.Platform === 'darwin') ?
|
||||||
|
'upgrade.dmg' :
|
||||||
|
'repertory-ui_' + this.props.UpgradeVersion + '_linux_x86_64.AppImage';
|
||||||
|
this.props.downloadItem(name, Constants.INSTALL_TYPES.Upgrade, this.props.UpgradeData.urls[0], this.onDownloadFileComplete);
|
||||||
};
|
};
|
||||||
|
|
||||||
installDependency = result => {
|
installDependency = result => {
|
||||||
@@ -338,6 +341,7 @@ const mapStateToProps = state => {
|
|||||||
UpgradeAvailable: state.relver.UpgradeAvailable,
|
UpgradeAvailable: state.relver.UpgradeAvailable,
|
||||||
UpgradeData: state.relver.UpgradeData,
|
UpgradeData: state.relver.UpgradeData,
|
||||||
UpgradeDismissed: state.relver.UpgradeDismissed,
|
UpgradeDismissed: state.relver.UpgradeDismissed,
|
||||||
|
UpgradeVersion: state.relver.UpgradeVersion,
|
||||||
Version: state.common.Version,
|
Version: state.common.Version,
|
||||||
VersionLookup: state.relver.VersionLookup,
|
VersionLookup: state.relver.VersionLookup,
|
||||||
};
|
};
|
||||||
|
|||||||
@@ -26,7 +26,7 @@ export const detectUIUpgrade = () => {
|
|||||||
data.Versions[appPlatform] &&
|
data.Versions[appPlatform] &&
|
||||||
(data.Versions[appPlatform].length > 0) &&
|
(data.Versions[appPlatform].length > 0) &&
|
||||||
(data.Versions[appPlatform][0] !== version)) {
|
(data.Versions[appPlatform][0] !== version)) {
|
||||||
dispatch(setUIUpgradeData(data.Locations[appPlatform][data.Versions[appPlatform][0]]));
|
dispatch(setUIUpgradeData(data.Locations[appPlatform][data.Versions[appPlatform][0]], data.Versions[appPlatform][0]));
|
||||||
} else {
|
} else {
|
||||||
dispatch(clearUIUpgrade());
|
dispatch(clearUIUpgrade());
|
||||||
}
|
}
|
||||||
@@ -115,4 +115,14 @@ export const setReleaseData = (locationsLookup, versionLookup)=> {
|
|||||||
};
|
};
|
||||||
|
|
||||||
export const setReleaseUpgradeAvailable = createAction('relver/setReleaseUpgradeAvailable');
|
export const setReleaseUpgradeAvailable = createAction('relver/setReleaseUpgradeAvailable');
|
||||||
export const setUIUpgradeData = createAction('relver/setUIUpgradeData');
|
|
||||||
|
export const SET_UI_UPGRADE_DATA = 'relver/setUIUpgradeData';
|
||||||
|
export const setUIUpgradeData = (upgradeData, version) => {
|
||||||
|
return {
|
||||||
|
type: SET_UI_UPGRADE_DATA,
|
||||||
|
payload: {
|
||||||
|
upgrade_data: upgradeData,
|
||||||
|
version: version,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
};
|
||||||
@@ -20,6 +20,7 @@ export const releaseVersionReducer = createReducer({
|
|||||||
ReleaseUpgradeAvailable: false,
|
ReleaseUpgradeAvailable: false,
|
||||||
UpgradeAvailable: false,
|
UpgradeAvailable: false,
|
||||||
UpgradeData: null,
|
UpgradeData: null,
|
||||||
|
UpgradeVersion: null,
|
||||||
UpgradeDismissed: false,
|
UpgradeDismissed: false,
|
||||||
Version: -1,
|
Version: -1,
|
||||||
VersionLookup: versionLookup,
|
VersionLookup: versionLookup,
|
||||||
@@ -30,6 +31,7 @@ export const releaseVersionReducer = createReducer({
|
|||||||
UpgradeAvailable: false,
|
UpgradeAvailable: false,
|
||||||
UpgradeDismissed: false,
|
UpgradeDismissed: false,
|
||||||
UpgradeData: null,
|
UpgradeData: null,
|
||||||
|
UpgradeVersion: null,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
[Actions.SET_ACTIVE_RELEASE]: (state, action) => {
|
[Actions.SET_ACTIVE_RELEASE]: (state, action) => {
|
||||||
@@ -64,11 +66,12 @@ export const releaseVersionReducer = createReducer({
|
|||||||
ReleaseUpgradeAvailable: action.payload,
|
ReleaseUpgradeAvailable: action.payload,
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
[Actions.setUIUpgradeData]: (state, action) => {
|
[Actions.SET_UI_UPGRADE_DATA]: (state, action) => {
|
||||||
return {
|
return {
|
||||||
...state,
|
...state,
|
||||||
UpgradeAvailable: true,
|
UpgradeAvailable: true,
|
||||||
UpgradeData: action.payload,
|
UpgradeData: action.payload.upgrade_data,
|
||||||
|
UpgradeVersion: action.payload.version,
|
||||||
UpgradeDismissed: false,
|
UpgradeDismissed: false,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user