mirror of
https://github.com/quine-global/hyper.git
synced 2026-01-12 20:18:41 -09:00
Keep homedir as session startup endpoint (#3506)
This commit is contained in:
parent
2d399baa87
commit
9581f5d5ee
2 changed files with 10 additions and 6 deletions
|
|
@ -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
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue