Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions src-node/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

13 changes: 8 additions & 5 deletions src/extensionsIntegrated/appUpdater/update-electron.js
Original file line number Diff line number Diff line change
Expand Up @@ -154,17 +154,20 @@
/**
* Check if we're at an upgradable location.
* For Electron on Linux, we require the AppImage to be in ~/.phoenix-code/
* (the path the installer.sh writes to).
*/
async function isUpgradableLocation() {
try {
const isPackaged = await window.electronAPI.isPackaged();
if (!isPackaged) {
const installedPath = await window.electronAPI.getInstalledAppPath();

Check warning on line 161 in src/extensionsIntegrated/appUpdater/update-electron.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=phcode-dev_phoenix&issues=AZ40NmaN2fnSISr3bUbO&open=AZ40NmaN2fnSISr3bUbO&pullRequest=2926
if (!installedPath) {
return false;
}
const homeDir = await window.electronFSAPI.homeDir();
let homeDir = await window.electronFSAPI.homeDir();

Check warning on line 165 in src/extensionsIntegrated/appUpdater/update-electron.js

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Prefer `globalThis` over `window`.

See more on https://sonarcloud.io/project/issues?id=phcode-dev_phoenix&issues=AZ40NmaN2fnSISr3bUbP&open=AZ40NmaN2fnSISr3bUbP&pullRequest=2926
if (!homeDir.endsWith("/")) {
homeDir = homeDir + "/";
}
const phoenixInstallDir = `${homeDir}.phoenix-code/`;
const execPath = await window.electronAPI.getExecutablePath();
return execPath.startsWith(phoenixInstallDir);
return installedPath.startsWith(phoenixInstallDir);
} catch (e) {
console.error(e);
return false;
Expand Down
Loading