Repository navigation
feat: ship a self-updating .rpm and import exported CLI transcripts #27644
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
riyadmondol2006
wants to merge
3
commits into
pingdotgg:main
from
riyadmondol2006:feat/linux-rpm-transcript-import
Closed
Changes from all commits
Commits
Show all changes
3 commits
Select commit
Hold shift + click to select a range
b5ee8b7
feat(desktop): ship a self-updating .rpm that coexists with the AppImage
riyadmondol2006 464dbda
feat: import an exported CLI transcript into a project
riyadmondol2006 c4f4c7f
style: wrap the transcript import telemetry entry and permission test…
riyadmondol2006 File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,23 @@ | ||
| #!/bin/bash | ||
|
|
||
| # electron-builder's after-remove template, run as %postun. rpm passes the number of installs | ||
| # left: 0 on erase, 1 when an upgrade runs the old package's %postun after the new %post. | ||
| # Cleaning up then would remove the link and profile the new package just installed. | ||
| [ "$1" = "0" ] || exit 0 | ||
|
|
||
| if type update-alternatives >/dev/null 2>&1; then | ||
| update-alternatives --remove '${executable}' '/opt/${sanitizedProductName}/${executable}' | ||
| else | ||
| rm -f '/usr/bin/${executable}' | ||
| fi | ||
|
|
||
| APPARMOR_PROFILE_DEST='/etc/apparmor.d/${executable}' | ||
|
|
||
| if [ -f "$APPARMOR_PROFILE_DEST" ]; then | ||
| if apparmor_status --enabled > /dev/null 2>&1; then | ||
| if ! { [ -x '/usr/bin/ischroot' ] && /usr/bin/ischroot; } && hash apparmor_parser 2>/dev/null; then | ||
| apparmor_parser --remove "$APPARMOR_PROFILE_DEST" || true | ||
| fi | ||
| fi | ||
| rm -f "$APPARMOR_PROFILE_DEST" | ||
| fi |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,38 @@ | ||
| import * as Effect from "effect/Effect"; | ||
| import * as FileSystem from "effect/FileSystem"; | ||
| import * as Option from "effect/Option"; | ||
|
|
||
| import type * as DesktopEnvironment from "./DesktopEnvironment.ts"; | ||
|
|
||
| // electron-builder writes resources/package-type into its .deb and .rpm; electron-updater reads | ||
| // the same marker to install updates with dpkg, or dnf/zypper. | ||
| const SYSTEM_PACKAGE_TYPES: ReadonlyArray<string> = ["deb", "rpm"]; | ||
|
|
||
| export const isSystemPackageType = (marker: string) => SYSTEM_PACKAGE_TYPES.includes(marker.trim()); | ||
|
|
||
| // electron-builder installs the .deb and .rpm at /opt/<productName>; the packaged product name is | ||
| // the display name, so each channel has its own install. | ||
| export const systemPackagePaths = (displayName: string) => { | ||
| const root = `/opt/${displayName}`; | ||
| return { | ||
| marker: `${root}/resources/package-type`, | ||
| executable: `${root}/t3code`, | ||
| serverEntry: `${root}/resources/app.asar/apps/server/dist/bin.mjs`, | ||
| }; | ||
| }; | ||
|
|
||
| /** | ||
| * The .deb or .rpm of this channel when an AppImage runs beside one. Shared launch integration | ||
| * points at the package then, so removing the AppImage leaves links and the `t3` command working. | ||
| */ | ||
| export const findSystemPackageBesideAppImage = Effect.fn( | ||
| "DesktopLinuxPackage.findSystemPackageBesideAppImage", | ||
| )(function* (environment: DesktopEnvironment.DesktopEnvironment["Service"]) { | ||
| if (environment.platform !== "linux" || Option.isNone(environment.appImagePath)) { | ||
| return Option.none<ReturnType<typeof systemPackagePaths>>(); | ||
| } | ||
| const fileSystem = yield* FileSystem.FileSystem; | ||
| const paths = systemPackagePaths(environment.displayName); | ||
| const marker = yield* fileSystem.readFileString(paths.marker).pipe(Effect.option); | ||
| return Option.filter(marker, isSystemPackageType).pipe(Option.as(paths)); | ||
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Give openSUSE its
zyppercommand.The heading includes openSUSE, but the only command uses
dnf. An openSUSE installation withoutdnfcannot follow these steps. Addsudo zypper install ./T3-Code-*.rpmfor openSUSE, asdocs/user/install.mdalready does. openSUSE documentszypperfor installing a local RPM. (doc.opensuse.org)