Keep homedir as session startup endpoint (#3506)

This commit is contained in:
Philippe Potvin 2019-03-02 17:58:19 -05:00 committed by GitHub
parent 2d399baa87
commit 9581f5d5ee
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 6 deletions

View file

@ -1,4 +1,5 @@
// This module exports paths, names, and other metadata that is referenced
const {homedir} = require('os');
const {app} = require('electron');
const {statSync} = require('fs');
const {resolve, join} = require('path');
@ -6,10 +7,12 @@ const isDev = require('electron-is-dev');
const cfgFile = '.hyper.js';
const defaultCfgFile = 'config-default.js';
const homeDir = app.getPath('userData');
const homeDirectory = homedir();
let cfgPath = join(homeDir, cfgFile);
let cfgDir = homeDir;
const applicationDirectory = app.getPath('userData');
let cfgPath = join(applicationDirectory, cfgFile);
let cfgDir = applicationDirectory;
const devDir = resolve(__dirname, '../..');
const devCfg = join(devDir, cfgFile);
@ -68,5 +71,6 @@ module.exports = {
plugs,
yarn,
cliScriptPath,
cliLinkPath
cliLinkPath,
homeDirectory
};

View file

@ -6,7 +6,7 @@ const fileUriToPath = require('file-uri-to-path');
const isDev = require('electron-is-dev');
const updater = require('../updater');
const toElectronBackgroundColor = require('../utils/to-electron-background-color');
const {icon, cfgDir} = require('../config/paths');
const {icon, homeDirectory} = require('../config/paths');
const createRPC = require('../rpc');
const notify = require('../notify');
const fetchNotifications = require('../notifications');
@ -103,7 +103,7 @@ module.exports = class Window {
{
rows: 40,
cols: 100,
cwd: process.argv[1] && isAbsolute(process.argv[1]) ? process.argv[1] : cfgDir,
cwd: process.argv[1] && isAbsolute(process.argv[1]) ? process.argv[1] : homeDirectory,
splitDirection: undefined,
shell: cfg.shell,
shellArgs: cfg.shellArgs && Array.from(cfg.shellArgs)