-
-
Notifications
You must be signed in to change notification settings - Fork 70
Add string path #660
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
base: main
Are you sure you want to change the base?
Add string path #660
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -1048,6 +1048,8 @@ async function handleSettings (hasChanged = false) { | |
| document.getElementById('settings-enable-wayland-container').classList.remove('d-none') | ||
| document.getElementById('settings-use-xinput2-container').classList.remove('d-none') | ||
| document.getElementById('settings-use-portals-container').classList.remove('d-none') | ||
| document.getElementById('settings-use-linked-rt').classList.remove('d-none') | ||
| document.getElementById('settings-settings-linked-rt-path').classList.remove('d-none') | ||
| } | ||
|
|
||
| // Hide patching setting on macOS | ||
|
|
@@ -1063,6 +1065,8 @@ async function handleSettings (hasChanged = false) { | |
| document.getElementById('settings-use-xinput2').checked = config.runtime_use_xinput2 | ||
| document.getElementById('settings-use-portals').checked = config.runtime_use_portals | ||
| document.getElementById('settings-always-patch').checked = config.always_patch | ||
| document.getElementById('settings-use-linked-rt').checked = config.use_linked_runtime | ||
| document.getElementById('settings-settings-linked-rt-path').checked = config.linked_runtime_path | ||
|
|
||
| // Enable settings inputs | ||
| document.getElementById('settings-enable-wayland-container').title = '' | ||
|
|
@@ -1098,6 +1102,12 @@ async function handleSettings (hasChanged = false) { | |
| config.always_patch = this.checked | ||
| await setConfig(config) | ||
| }) | ||
|
|
||
| // Listen for use linked Runtime | ||
| document.getElementById('settings-use-linked-rt').addEventListener('change', async function () { | ||
| config.always_patch = this.checked | ||
| await setConfig(config) | ||
| }) | ||
|
Comment on lines
+1106
to
+1110
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It seems handling the runtime path is missing here. |
||
| }) | ||
|
|
||
| // Hide runtime reinstallation button on unsupported platforms | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -365,11 +365,12 @@ impl Runtime { | |
| self.uninstall()?; | ||
|
|
||
| storage.config.use_linked_runtime = true; | ||
| storage.config.linked_runtime_path = FFOX.to_string(); | ||
|
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This probybly shouldn't override the user-configured path. |
||
|
|
||
| info!("Linking the runtime"); | ||
|
|
||
| if Path::new(FFOX).exists() { | ||
| for entry in read_dir(FFOX)?.flatten() { | ||
| if Path::new(&storage.config.linked_runtime_path).exists() { | ||
| for entry in read_dir(&storage.config.linked_runtime_path)?.flatten() { | ||
| let entry = entry.path(); | ||
| match entry.file_name().expect("Couldn't retrieve a file name").to_str() { | ||
| // Use a different branch for the "defaults" folder due to the patches to apply afterwhile | ||
|
|
||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -6,6 +6,8 @@ use clap::{ArgAction, Parser}; | |
| use ulid::Ulid; | ||
| use url::Url; | ||
|
|
||
| const FFOX: &str = "/usr/lib/firefox/"; | ||
|
|
||
| #[derive(Parser, Debug, Eq, PartialEq, Clone)] | ||
| #[clap(propagate_version = true)] | ||
| #[clap(version)] | ||
|
|
@@ -278,8 +280,13 @@ pub enum RuntimeCommand { | |
| pub struct RuntimeInstallCommand { | ||
| /// Experimental: Use a linked runtime instead of downloading from Mozilla | ||
| #[cfg(target_os = "linux")] | ||
| #[clap(long)] | ||
| #[clap(long, short)] | ||
| pub link: bool, | ||
| /// Experimental: Use a linked runtime instead of downloading from Mozilla. | ||
| /// Optional: Path of my firefox runtime | ||
| #[cfg(target_os = "linux")] | ||
| #[clap(long, value_name = FFOX)] | ||
| pub path: String, | ||
|
Comment on lines
281
to
+289
Owner
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Maybe it would be better if this is a single option/parameter that can optionally take a path. So, when This should probably also be reflected in the storage/config. So that the path is only stored when its explicitly set. |
||
| } | ||
|
|
||
| #[derive(Parser, Debug, Eq, PartialEq, Clone)] | ||
|
|
||
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.
runtimeinstead ofrtfor element IDs seems nicer.