Skip to content

Commit

Permalink
Make sure paths are added
Browse files Browse the repository at this point in the history
  • Loading branch information
Kitenite committed Dec 11, 2024
1 parent 246df22 commit ec02e6c
Showing 1 changed file with 3 additions and 4 deletions.
7 changes: 3 additions & 4 deletions apps/studio/electron/main/requirements/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ export function checkSystemRequirements(): RequirementsResponse {

function checkGitInstallation(): boolean {
try {
execSync('git --version', { stdio: 'ignore', env: process.env });
execSync('git --version', { stdio: 'ignore' });
return true;
} catch (error) {
console.error('Git check failed:', error);
Expand All @@ -23,7 +23,7 @@ function checkGitInstallation(): boolean {

function checkNodeInstallation(): boolean {
try {
const additionalNodePaths = [
const versionManagerPaths = [
`${process.env.HOME}/.nvm/versions/node`, // Nvm
`${process.env.HOME}/.fnm/node-versions`, // Fnm
`${process.env.N_PREFIX}/bin`, // N
Expand All @@ -34,10 +34,9 @@ function checkNodeInstallation(): boolean {
]
.filter(Boolean);

// Combine existing PATH with additional paths
const existingPath = process.env.PATH || '';
const pathSeparator = process.platform === 'win32' ? ';' : ':';
const enhancedPath = [...additionalNodePaths, existingPath].join(pathSeparator);
const enhancedPath = [...versionManagerPaths, existingPath].join(pathSeparator);

execSync('npm --version', { stdio: 'ignore', env: { ...process.env, PATH: enhancedPath } });
return true;
Expand Down

0 comments on commit ec02e6c

Please sign in to comment.