mirror of
https://github.com/desktop/desktop
synced 2024-10-05 15:49:27 +00:00
update usages to point to new modules
This commit is contained in:
parent
ab4bc5002b
commit
83f2aa6474
|
@ -6,6 +6,8 @@ const HtmlWebpackPlugin = require('html-webpack-plugin')
|
||||||
const CleanWebpackPlugin = require('clean-webpack-plugin')
|
const CleanWebpackPlugin = require('clean-webpack-plugin')
|
||||||
const webpack = require('webpack')
|
const webpack = require('webpack')
|
||||||
const merge = require('webpack-merge')
|
const merge = require('webpack-merge')
|
||||||
|
const appInfo = require('./app-info')
|
||||||
|
const packageInfo = require('./package-info')
|
||||||
const distInfo = require('../script/dist-info')
|
const distInfo = require('../script/dist-info')
|
||||||
|
|
||||||
const devClientId = '3a723b10ac5575cc5bb9'
|
const devClientId = '3a723b10ac5575cc5bb9'
|
||||||
|
@ -13,25 +15,7 @@ const devClientSecret = '22c34d87789a365981ed921352a7b9a8c3f69d54'
|
||||||
|
|
||||||
const channel = distInfo.getReleaseChannel()
|
const channel = distInfo.getReleaseChannel()
|
||||||
|
|
||||||
const replacements = {
|
const replacements = appInfo.getReplacements()
|
||||||
__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 outputDir = 'out'
|
const outputDir = 'out'
|
||||||
|
|
||||||
|
|
|
@ -10,14 +10,13 @@ import * as packager from 'electron-packager'
|
||||||
const legalEagle: LegalEagle = require('legal-eagle')
|
const legalEagle: LegalEagle = require('legal-eagle')
|
||||||
|
|
||||||
import {
|
import {
|
||||||
getReleaseChannel,
|
|
||||||
getDistRoot,
|
|
||||||
getExecutableName,
|
|
||||||
getBundleID,
|
getBundleID,
|
||||||
getCompanyName,
|
getCompanyName,
|
||||||
getProductName,
|
getProductName,
|
||||||
getVersion,
|
getVersion,
|
||||||
} from './dist-info'
|
} from '../app/package-info'
|
||||||
|
|
||||||
|
import { getReleaseChannel, getDistRoot, getExecutableName } from './dist-info'
|
||||||
|
|
||||||
const projectRoot = path.join(__dirname, '..')
|
const projectRoot = path.join(__dirname, '..')
|
||||||
const outRoot = path.join(projectRoot, 'out')
|
const outRoot = path.join(projectRoot, 'out')
|
||||||
|
|
|
@ -4,13 +4,12 @@ import * as fs from 'fs-extra'
|
||||||
import * as cp from 'child_process'
|
import * as cp from 'child_process'
|
||||||
import * as path from 'path'
|
import * as path from 'path'
|
||||||
import * as electronInstaller from 'electron-winstaller'
|
import * as electronInstaller from 'electron-winstaller'
|
||||||
|
import { getProductName, getCompanyName } from '../app/package-info'
|
||||||
import {
|
import {
|
||||||
getDistRoot,
|
getDistRoot,
|
||||||
getDistPath,
|
getDistPath,
|
||||||
getProductName,
|
|
||||||
getOSXZipPath,
|
getOSXZipPath,
|
||||||
getWindowsIdentifierName,
|
getWindowsIdentifierName,
|
||||||
getCompanyName,
|
|
||||||
getWindowsStandaloneName,
|
getWindowsStandaloneName,
|
||||||
getWindowsInstallerName,
|
getWindowsInstallerName,
|
||||||
shouldMakeDelta,
|
shouldMakeDelta,
|
||||||
|
|
|
@ -5,6 +5,7 @@
|
||||||
const TEST_PUBLISH = false
|
const TEST_PUBLISH = false
|
||||||
const PUBLISH_CHANNELS = ['production', 'test', 'beta']
|
const PUBLISH_CHANNELS = ['production', 'test', 'beta']
|
||||||
const distInfo = require('./dist-info')
|
const distInfo = require('./dist-info')
|
||||||
|
const gitInfo = require('../app/git-info')
|
||||||
|
|
||||||
if (PUBLISH_CHANNELS.indexOf(distInfo.getReleaseChannel()) < 0) {
|
if (PUBLISH_CHANNELS.indexOf(distInfo.getReleaseChannel()) < 0) {
|
||||||
console.log('Not a publishable build. Skipping publish.')
|
console.log('Not a publishable build. Skipping publish.')
|
||||||
|
@ -17,7 +18,7 @@ if (!releaseSHA) {
|
||||||
process.exit(0)
|
process.exit(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
const currentTipSHA = distInfo.getSHA()
|
const currentTipSHA = gitInfo.getSHA()
|
||||||
if (
|
if (
|
||||||
!currentTipSHA ||
|
!currentTipSHA ||
|
||||||
!currentTipSHA.toUpperCase().startsWith(releaseSHA.toUpperCase())
|
!currentTipSHA.toUpperCase().startsWith(releaseSHA.toUpperCase())
|
||||||
|
|
|
@ -2,7 +2,28 @@
|
||||||
|
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
import * as path from 'path'
|
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> {
|
export function getLogFiles(): ReadonlyArray<string> {
|
||||||
const directory = path.join(getUserDataPath(), 'logs')
|
const directory = path.join(getUserDataPath(), 'logs')
|
||||||
|
|
|
@ -3,7 +3,8 @@
|
||||||
import * as fs from 'fs'
|
import * as fs from 'fs'
|
||||||
import * as cp from 'child_process'
|
import * as cp from 'child_process'
|
||||||
import { getLogFiles } from './review-logs'
|
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
|
const isFork = process.env.CIRCLE_PR_USERNAME
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue