diff --git a/.gitignore b/.gitignore index f52a155..52f3e51 100644 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # custom scripts/redis-installed +scripts/redis-stable.tar.gz +scripts/redis-stable/* diff --git a/package.json b/package.json index 20614f2..ed78e36 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "cheatsheet", - "version": "1.1.3", + "version": "1.2.0", "description": "A knowledge base for short snippets", "main": "app.js", "scripts": { diff --git a/scripts/install-redis-linux.sh b/scripts/install-redis-linux.sh new file mode 100644 index 0000000..6a69502 --- /dev/null +++ b/scripts/install-redis-linux.sh @@ -0,0 +1,16 @@ +#!/bin/bash + +# https://redis.io/topics/quickstart +# This is the way to install on Linux, apparently... + +# Download tarball +# Extract source +# Make +# Run Redis Server + +wget http://download.redis.io/redis-stable.tar.gz +tar xzf redis-stable.tar.gz +cd redis-stable +make +cd src +./redis-server & diff --git a/scripts/install-redis-mac.sh b/scripts/install-redis-mac.sh new file mode 100644 index 0000000..55a6fe8 --- /dev/null +++ b/scripts/install-redis-mac.sh @@ -0,0 +1,4 @@ +#!/bin/bash + +brew install redis +brew services start redis diff --git a/scripts/post-install.js b/scripts/post-install.js index 63dd83d..8f75d3b 100755 --- a/scripts/post-install.js +++ b/scripts/post-install.js @@ -3,15 +3,16 @@ const {exec} = require('child_process') switch (process.platform) { case 'win32': + // Windows // TODO: Move the logic for installing on windows here from the bat file exec('call scripts/install-redis-windows.bat') break case 'darwin': - console.log( - 'Automated install of Redis currently not implemented on Mac OS' - ) + // Mac + exec('sh scripts/install-redis-mac.sh') break case 'linux': - console.log('Automated install of Redis currently not implemented on Linux') + // ... Linux + exec('sh scripts/install-redis-linux.sh') break }