Commit 231d269a authored by Aral Balkan's avatar Aral Balkan
Browse files

Add Owncast install script to Nexe bundle

(and copy/execute from there at runtime.)
parent b2bba8ff
......@@ -232,6 +232,9 @@ const resources = [
// Not sure if this is a different regression in Nexe 4’s resolve dependencies.
// Afaik, it was being included correctly before.
// Bundle the Owncast installation script.
const input = 'bin/site.js'
......@@ -252,8 +252,13 @@ function enable (args) {
try {
const owncastInstallationScript = path.resolve(path.join(__dirname, '..', 'sh', ''))
childProcess.execSync(`OWNCAST_INSTALL_DIRECTORY=${owncastDirectory} ${owncastInstallationScript}`, {env: process.env, stdio: 'pipe'})
// Copy the installation script to our settings directory
// and run it from there (for when we’re running from within a Nexe bundle).
const internalOwncastInstallationScriptPath = path.resolve(path.join(__dirname, '..', 'sh', ''))
const installationScript = fs.readFileSync(internalOwncastInstallationScriptPath, 'utf-8')
const externalOwncastInstallationScriptPath = path.join(Site.settingsDirectory, '')
fs.writeFileSync(externalOwncastInstallationScriptPath, installationScript, {encoding: 'utf-8', mode: 0o755})
childProcess.execSync(`OWNCAST_INSTALL_DIRECTORY=${owncastDirectory} ${externalOwncastInstallationScriptPath}`, {env: process.env, stdio: 'pipe'})
console.log(` 💮️ ❨site.js❩ Owncast installed at ${owncastDirectory}.`)
} catch (error) {
console.log(error, `\n ❌ ${clr('❨site.js❩ Error:', 'red')} Could not install Owncast.\n`)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment