2017-02-14 20:27:08 +00:00
|
|
|
'use strict'
|
|
|
|
|
2017-04-08 20:16:13 +00:00
|
|
|
// =====================================================
|
|
|
|
// Wiki.js
|
|
|
|
// Installation Script
|
|
|
|
// =====================================================
|
|
|
|
|
2017-02-14 20:27:08 +00:00
|
|
|
const path = require('path')
|
2017-08-06 16:42:03 +00:00
|
|
|
const spawn = require('child_process').spawn
|
2017-04-08 20:16:13 +00:00
|
|
|
const installDir = path.resolve(__dirname, '../..')
|
2017-08-06 16:42:03 +00:00
|
|
|
const cmd = (process.platform !== 'win32')
|
|
|
|
? 'curl -s -S -o- https://wiki.js.org/install.sh | bash'
|
|
|
|
: `PowerShell.exe -NoProfile -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://wiki.js.org/install.ps1'))"`
|
|
|
|
|
|
|
|
console.info(`Executing installation script for ${process.platform} platform...`)
|
|
|
|
|
|
|
|
let inst = spawn(cmd, [], {
|
|
|
|
cwd: installDir,
|
|
|
|
env: process.env,
|
|
|
|
shell: true,
|
|
|
|
stdio: 'inherit',
|
|
|
|
detached: true
|
2017-02-14 20:27:08 +00:00
|
|
|
})
|
2017-08-06 16:42:03 +00:00
|
|
|
|
|
|
|
inst.unref()
|