|
|
const config = require( '../../../config/config.json' ); |
|
|
const pkg = require( '../../../package.json' ); |
|
|
|
|
|
|
|
|
config.name = pkg.productName; |
|
|
config.description = 'WordPress Desktop'; |
|
|
config.version = pkg.version; |
|
|
config.author = pkg.author; |
|
|
|
|
|
config.protocol = 'wpdesktop'; |
|
|
|
|
|
config.oauthLoginEnabled = process.platform !== 'linux'; |
|
|
|
|
|
config.loginURL = function () { |
|
|
const loginUri = ! config.oauthLoginEnabled ? 'log-in' : 'log-in/desktop'; |
|
|
return this.baseURL() + loginUri; |
|
|
}; |
|
|
|
|
|
config.baseURL = function () { |
|
|
if ( process.env.WP_DESKTOP_BASE_URL !== undefined ) { |
|
|
return `${ process.env.WP_DESKTOP_BASE_URL }/`; |
|
|
} |
|
|
|
|
|
return 'https://wordpress.com/'; |
|
|
}; |
|
|
|
|
|
config.isRelease = function () { |
|
|
return this.build === 'release'; |
|
|
}; |
|
|
|
|
|
config.isUpdater = function () { |
|
|
return this.build === 'updater'; |
|
|
}; |
|
|
|
|
|
config.isBeta = function () { |
|
|
return this.build === 'beta'; |
|
|
}; |
|
|
|
|
|
|
|
|
config.toRenderer = function () { |
|
|
return { |
|
|
build: this.build, |
|
|
version: this.version, |
|
|
}; |
|
|
}; |
|
|
|
|
|
module.exports = config; |
|
|
|