Skip to content

Commit

Permalink
Keep homedir as session startup endpoint (#3506)
Browse files Browse the repository at this point in the history
  • Loading branch information
ppot committed Mar 2, 2019
1 parent 2d399ba commit 9581f5d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 6 deletions.
12 changes: 8 additions & 4 deletions app/config/paths.js
Original file line number Diff line number Diff line change
@@ -1,15 +1,18 @@
// 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');
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);
Expand Down Expand Up @@ -68,5 +71,6 @@ module.exports = {
plugs,
yarn,
cliScriptPath,
cliLinkPath
cliLinkPath,
homeDirectory
};
4 changes: 2 additions & 2 deletions app/ui/window.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
Expand Down Expand Up @@ -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)
Expand Down

0 comments on commit 9581f5d

Please sign in to comment.