Skip to content

Commit

Permalink
Merge pull request #1334 from rikoe/fix-openfin-mac-installers
Browse files Browse the repository at this point in the history
fix(client): update installer generator script for macOS
  • Loading branch information
rikoe authored Dec 31, 2019
2 parents e5f0cc1 + 7fa41f3 commit e29f935
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 9 deletions.
Binary file modified src/client/install/ReactiveTraderCloud-demo.dmg
Binary file not shown.
Binary file modified src/client/install/ReactiveTraderCloud-dev.dmg
Binary file not shown.
Binary file added src/client/install/ReactiveTraderCloud-uat.dmg
Binary file not shown.
23 changes: 14 additions & 9 deletions src/client/lib/downloadInstaller.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,24 @@
const https = require('https')
const getJSON = require('get-json')
const fs = require('fs')

// const childProcess = require('child_process')
const getInstallerGeneratorUrl = async (fileName, appJSONUrl, os) => {
const installerGeneratorUrl = `https://install.openfin.co/download/?config=${appJSONUrl}&fileName=${fileName}&os=${os}`;

// const getCurrentGitBranchName = () =>
// new Promise(resolve => {
// childProcess.exec(`git rev-parse --abbrev-ref HEAD`, (err, stdout, stderr) => {
// resolve((stdout || '').trimRight())
// })
// })
if (os === 'osx') {
const appJSON = await getJSON(appJSONUrl)
const appName = appJSON.startup_app.name
const iconFile = appJSON.startup_app.applicationIcon
return `${installerGeneratorUrl}&internal=true&appName=${appName}&iconFile=${iconFile}`
}

const createInstaller = (branch, manifestName, os='win') => {
return `${installerGeneratorUrl}&unzipped=true`
}

const createInstaller = async (branch, manifestName, os = 'win') => {
const fileName = `ReactiveTraderCloud-${manifestName}`
const appJSONUrl = `https://raw.githubusercontent.com/AdaptiveConsulting/ReactiveTraderCloud/${branch}/src/client/public/config/openfin/${manifestName}.json`
const installerGeneratorUrl = `https://install.openfin.co/download/?unzipped=true&config=${appJSONUrl}&fileName=${fileName}&os=${os}`
const installerGeneratorUrl = await getInstallerGeneratorUrl(fileName, appJSONUrl, os)
const extension = os === 'win' ? 'exe' : 'dmg'

console.log(` - Generating installer: \x1b[36m${fileName}.${extension}\x1b[0m (points to \x1b[36m${branch}\x1b[0m branch)`)
Expand Down
32 changes: 32 additions & 0 deletions src/client/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions src/client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,7 @@
"core-js": "^2.5.7",
"cors": "^2.8.5",
"cross-env": "^6.0.3",
"get-json": "^1.0.1",
"npm-run-all": "^4.1.2",
"react-scripts": "^3.3.0",
"react-test-renderer": "^16.12.0",
Expand Down

0 comments on commit e29f935

Please sign in to comment.