1
0
mirror of https://github.com/desktop/desktop synced 2024-07-05 00:58:57 +00:00

update usages to point to new modules

This commit is contained in:
Brendan Forster 2017-11-20 12:30:16 +11:00
parent ab4bc5002b
commit 83f2aa6474
6 changed files with 33 additions and 28 deletions

View File

@ -6,6 +6,8 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
const CleanWebpackPlugin = require('clean-webpack-plugin')
const webpack = require('webpack')
const merge = require('webpack-merge')
const appInfo = require('./app-info')
const packageInfo = require('./package-info')
const distInfo = require('../script/dist-info')
const devClientId = '3a723b10ac5575cc5bb9'
@ -13,25 +15,7 @@ const devClientSecret = '22c34d87789a365981ed921352a7b9a8c3f69d54'
const channel = distInfo.getReleaseChannel()
const replacements = {
__OAUTH_CLIENT_ID__: JSON.stringify(
process.env.DESKTOP_OAUTH_CLIENT_ID || devClientId
),
__OAUTH_SECRET__: JSON.stringify(
process.env.DESKTOP_OAUTH_CLIENT_SECRET || devClientSecret
),
__DARWIN__: process.platform === 'darwin',
__WIN32__: process.platform === 'win32',
__LINUX__: process.platform === 'linux',
__DEV__: channel === 'development',
__RELEASE_CHANNEL__: JSON.stringify(channel),
__UPDATES_URL__: JSON.stringify(distInfo.getUpdatesURL()),
__SHA__: JSON.stringify(distInfo.getSHA()),
__CLI_COMMANDS__: JSON.stringify(distInfo.getCLICommands()),
'process.platform': JSON.stringify(process.platform),
'process.env.NODE_ENV': JSON.stringify(process.env.NODE_ENV || 'development'),
'process.env.TEST_ENV': JSON.stringify(process.env.TEST_ENV),
}
const replacements = appInfo.getReplacements()
const outputDir = 'out'

View File

@ -10,14 +10,13 @@ import * as packager from 'electron-packager'
const legalEagle: LegalEagle = require('legal-eagle')
import {
getReleaseChannel,
getDistRoot,
getExecutableName,
getBundleID,
getCompanyName,
getProductName,
getVersion,
} from './dist-info'
} from '../app/package-info'
import { getReleaseChannel, getDistRoot, getExecutableName } from './dist-info'
const projectRoot = path.join(__dirname, '..')
const outRoot = path.join(projectRoot, 'out')

View File

@ -4,13 +4,12 @@ import * as fs from 'fs-extra'
import * as cp from 'child_process'
import * as path from 'path'
import * as electronInstaller from 'electron-winstaller'
import { getProductName, getCompanyName } from '../app/package-info'
import {
getDistRoot,
getDistPath,
getProductName,
getOSXZipPath,
getWindowsIdentifierName,
getCompanyName,
getWindowsStandaloneName,
getWindowsInstallerName,
shouldMakeDelta,

View File

@ -5,6 +5,7 @@
const TEST_PUBLISH = false
const PUBLISH_CHANNELS = ['production', 'test', 'beta']
const distInfo = require('./dist-info')
const gitInfo = require('../app/git-info')
if (PUBLISH_CHANNELS.indexOf(distInfo.getReleaseChannel()) < 0) {
console.log('Not a publishable build. Skipping publish.')
@ -17,7 +18,7 @@ if (!releaseSHA) {
process.exit(0)
}
const currentTipSHA = distInfo.getSHA()
const currentTipSHA = gitInfo.getSHA()
if (
!currentTipSHA ||
!currentTipSHA.toUpperCase().startsWith(releaseSHA.toUpperCase())

View File

@ -2,7 +2,28 @@
import * as fs from 'fs'
import * as path from 'path'
import { getUserDataPath } from './dist-info'
import * as os from 'os'
import { getProductName } from '../app/package-info'
import { getExecutableName } from './dist-info'
function getUserDataPath() {
if (process.platform === 'win32') {
return path.join(process.env.APPDATA, getExecutableName())
} else if (process.platform === 'darwin') {
const home = os.homedir()
return path.join(home, 'Library', 'Application Support', getProductName())
} else if (process.platform === 'linux') {
if (process.env.XDG_CONFIG_HOME) {
return path.join(process.env.XDG_CONFIG_HOME, getProductName())
}
const home = os.homedir()
return path.join(home, '.config', getProductName())
} else {
throw new Error(
`I dunno how to resolve the user data path for ${process.platform} ${process.arch} :(`
)
}
}
export function getLogFiles(): ReadonlyArray<string> {
const directory = path.join(getUserDataPath(), 'logs')

View File

@ -3,7 +3,8 @@
import * as fs from 'fs'
import * as cp from 'child_process'
import { getLogFiles } from './review-logs'
import { getProductName, getDistPath } from './dist-info'
import { getProductName } from '../app/package-info'
import { getDistPath } from './dist-info'
const isFork = process.env.CIRCLE_PR_USERNAME