Skip to content

Commit c82f7f8

Browse files
committed
Add post-install JavaScript to determine OS and optionally install Redis
Partially fixes timschwab#10 (doesn't crash the installer anymore, still doesn't install Redis on anything other than Windows
1 parent 3334274 commit c82f7f8

File tree

3 files changed

+19
-2
lines changed

3 files changed

+19
-2
lines changed

Diff for: package-lock.json

+1-1
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
"main": "app.js",
66
"scripts": {
77
"start": "electron .",
8-
"postinstall": "call \"dist/redis/install.bat\""
8+
"postinstall": "node ./scripts/post-install.js"
99
},
1010
"repository": {
1111
"type": "git",

Diff for: scripts/post-install.js

+17
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
#! /usr/bin/env node
2+
const {exec} = require('child_process')
3+
4+
switch (process.platform) {
5+
case 'win32':
6+
// TODO: Move the logic for installing on windows here from the bat file
7+
exec('dist/redis/install.bat')
8+
break
9+
case 'darwin':
10+
console.log(
11+
'Automated install of Redis currently not implemented on Mac OS'
12+
)
13+
break
14+
case 'linux':
15+
console.log('Automated install of Redis currently not implemented on Linux')
16+
break
17+
}

0 commit comments

Comments
 (0)