fix the compiler warnings

This commit is contained in:
Brendan Forster 2018-06-22 10:44:22 -03:00
parent bbab6f36e5
commit 8110a3bb19
2 changed files with 16 additions and 2 deletions

View file

@ -123,10 +123,18 @@ function packageApp(
)
}
const toPackageArch = (targetArch: string | undefined): packager.arch => {
if (targetArch === 'arm64' || targetArch === 'x64') {
return targetArch
}
return 'x64'
}
const options: packager.Options & IPackageAdditionalOptions = {
name: getExecutableName(),
platform: toPackagePlatform(process.platform),
arch: process.env.TARGET_ARCH || 'x64',
arch: toPackageArch(process.env.TARGET_ARCH),
asar: false, // TODO: Probably wanna enable this down the road.
out: getDistRoot(),
icon: path.join(projectRoot, 'app', 'static', 'logos', 'icon-logo'),

View file

@ -8,7 +8,13 @@ import { getExecutableName } from './dist-info'
function getUserDataPath() {
if (process.platform === 'win32') {
return path.join(process.env.APPDATA, getExecutableName())
if (process.env.APPDATA) {
return path.join(process.env.APPDATA, getExecutableName())
} else {
throw new Error(
`Unable to find the application data directory on Windows :(`
)
}
} else if (process.platform === 'darwin') {
const home = os.homedir()
return path.join(home, 'Library', 'Application Support', getProductName())