mirror of https://github.com/icedream/ts3bot.git
Use os.homedir() and pass through %USERPROFILE%.
parent
653dfbef4e
commit
430b64e03b
|
@ -2,13 +2,14 @@ import nconf from 'nconf'
|
|||
import path from 'path'
|
||||
import merge from 'merge'
|
||||
import pwgen from 'password-generator'
|
||||
import { homedir } from 'os'
|
||||
|
||||
console.log "Loading configuration..."
|
||||
|
||||
# Build configuration object from input
|
||||
nconf.env [ "NODE_ENV", "PULSE_BINARY" ]
|
||||
nconf.argv()
|
||||
nconf.file path.join(process.env["HOME"], ".ts3bot", "config.json")
|
||||
nconf.file path.join(homedir(), ".ts3bot", "config.json")
|
||||
nconf.defaults
|
||||
# read http://stackoverflow.com/q/12252043 on why I'm using .trim here
|
||||
"environment": process.env.NODE_ENV?.trim() or "development"
|
||||
|
@ -18,7 +19,7 @@ nconf.defaults
|
|||
"vlc-password": pwgen()
|
||||
"nickname": "TS3Bot"
|
||||
"ts3-install-path": path.resolve __dirname, "..", "ts3client"
|
||||
"ts3-config-path": path.join process.env.HOME, ".ts3client"
|
||||
"ts3-config-path": path.join homedir(), ".ts3client"
|
||||
"xvfb-resolution": "800x600x16"
|
||||
"console-log-level": "info"
|
||||
"file-log-level": "debug"
|
||||
|
|
|
@ -1,5 +1,6 @@
|
|||
import { spawn } from 'child_process'
|
||||
import StreamSplitter from 'stream-splitter'
|
||||
import { homedir } from 'os'
|
||||
|
||||
import getLogger from '../logger'
|
||||
import services from '../services'
|
||||
|
@ -38,6 +39,7 @@ module.exports = class PulseAudioService extends services.Service
|
|||
env:
|
||||
DISPLAY: process.env.DISPLAY
|
||||
HOME: process.env.HOME
|
||||
USERPROFILE: process.env.USERPROFILE
|
||||
XDG_RUNTIME_DIR: process.env.XDG_RUNTIME_DIR
|
||||
|
||||
# check if there is already a daemon running
|
||||
|
|
|
@ -86,6 +86,7 @@ module.exports = class TS3ClientService extends services.Service
|
|||
doStart = () =>
|
||||
env =
|
||||
HOME: process.env.HOME
|
||||
USERPROFILE: process.env.USERPROFILE
|
||||
DISPLAY: process.env.DISPLAY
|
||||
XDG_RUNTIME_DIR: process.env.XDG_RUNTIME_DIR
|
||||
KDEDIRS: ''
|
||||
|
|
|
@ -42,6 +42,7 @@ module.exports = class XWindowManagerService extends services.Service
|
|||
DISPLAY: process.env.DISPLAY
|
||||
XDG_RUNTIME_DIR: process.env.XDG_RUNTIME_DIR
|
||||
HOME: process.env.HOME
|
||||
USERPROFILE: process.env.USERPROFILE
|
||||
|
||||
# logging
|
||||
stdoutTokenizer = proc.stdout.pipe StreamSplitter "\n"
|
||||
|
|
Loading…
Reference in New Issue