proper TELEBIT_CONFIG vars

This commit is contained in:
AJ ONeal 2018-06-24 02:16:04 -06:00
parent 3e9620ee90
commit fa29aa3faf
2 changed files with 4 additions and 2 deletions

View File

@ -11,7 +11,7 @@
<string>{TELEBIT_PATH}/bin/telebitd.js</string>
<string>daemon</string>
<string>--config</string>
<string>{TELEBIT_CONFIG_PATH}</string>
<string>{TELEBIT_CONFIGD}</string>
</array>
<key>EnvironmentVariables</key>

View File

@ -24,7 +24,8 @@ var vars = {
, ].join(' ')
, telebitUser: process.env.TELEBIT_USER || os.userInfo().username
, telebitGroup: process.env.TELEBIT_GROUP || ('darwin' === os.platform() ? 'staff' : os.userInfo().username)
, telebitConfig: process.env.TELEBIT_CONFIG || path.join(os.homedir(), '.config/telebit/telebitd.yml')
, telebitConfig: process.env.TELEBIT_CONFIG || path.join(os.homedir(), '.config/telebit/telebit.yml')
, telebitConfigd: process.env.TELEBIT_CONFIGD || path.join(os.homedir(), '.config/telebit/telebitd.yml')
};
files.forEach(function (f) {
var text = fs.readFileSync(f[0], 'utf8')
@ -33,6 +34,7 @@ files.forEach(function (f) {
.replace(/{TELEBIT_GROUP}/g, vars.telebitGroup)
.replace(/{TELEBIT_RW_DIRS}/g, vars.telebitRwDirs)
.replace(/{TELEBIT_CONFIG}/g, vars.telebitConfig)
.replace(/{TELEBIT_CONFIGD}/g, vars.telebitConfigd)
;
fs.writeFileSync(f[1], text, 'utf8');
});