Skip to content

Commit

Permalink
Use same version as main app
Browse files Browse the repository at this point in the history
  • Loading branch information
Rustem Mussabekov committed Feb 25, 2021
1 parent f911c0a commit 506afe7
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 2 deletions.
15 changes: 14 additions & 1 deletion forge.config.js
Original file line number Diff line number Diff line change
@@ -1,13 +1,26 @@
const path = require('path')
const util = require('util')
const exec = util.promisify(require('child_process').exec)
const fs = require('fs')

function updateVersion(version) {
const package = fs.readFileSync(`${__dirname}/package.json`, 'utf-8')
fs.writeFileSync(`${__dirname}/package.json`, package.replace(/version": "(.*)"/i, `version": "${version}"`), 'utf-8')
}

module.exports = {
hooks: {
generateAssets: async () => {
//build app from github repo
//get app repo
await exec('shx rm -rf out/app')
await exec('git clone https://github.com/raindropio/app.git -b release/production out/app')

//update version
updateVersion(
JSON.parse(fs.readFileSync(`${__dirname}/out/app/package.json`, 'utf-8')).version
)

//build app
await exec('cd out/app && yarn && yarn build:electron')
await exec('shx rm -rf app-bundle || true')
await exec('shx cp -r out/app/dist/electron/prod app-bundle')
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "Raindrop.io",
"productName": "Raindrop.io",
"version": "5.2.60",
"version": "1.0.0",
"description": "Crossplatform bookmarking app",
"main": "src/index.js",
"repository": {
Expand Down

0 comments on commit 506afe7

Please sign in to comment.