Skip to content

Commit

Permalink
Fix validation problems
Browse files Browse the repository at this point in the history
  • Loading branch information
filips123 committed Feb 7, 2023
1 parent bebb2da commit 14e8473
Show file tree
Hide file tree
Showing 3 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion extension/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@
"npm-run-all": "^4.1.5",
"parcel": "^2.8.2",
"rimraf": "^3.0.2",
"web-ext": "^7.4.0"
"web-ext": "^7.5.0"
},
"icons": [
"box-arrow-up-right",
Expand Down
14 changes: 7 additions & 7 deletions native/src/integrations/implementation/linux.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl SiteIds {
let name = site.name();
let description = site.description();
let ulid = site.ulid.to_string();
let classid = format!("FFPWA-{}", ulid);
let classid = format!("FFPWA-{ulid}");
Self { name, description, ulid, classid }
}
}
Expand Down Expand Up @@ -113,7 +113,7 @@ fn store_icons(
// Scalable (normal SVG) icons can be directly saved into the correct directory
if icon.purpose.contains(&ImagePurpose::Any) {
let directory = data.join("icons/hicolor/scalable/apps");
let filename = directory.join(format!("{}.svg", id));
let filename = directory.join(format!("{id}.svg"));

debug!("Saving as scalable icon");
create_dir_all(directory).context(CREATE_ICON_DIRECTORY_ERROR)?;
Expand All @@ -124,7 +124,7 @@ fn store_icons(
// Symbolic (monochrome SVG) icons can be directly saved into the correct directory
if icon.purpose.contains(&ImagePurpose::Monochrome) {
let directory = data.join("icons/hicolor/symbolic/apps");
let filename = directory.join(format!("{}-symbolic.svg", id));
let filename = directory.join(format!("{id}-symbolic.svg"));

debug!("Saving as symbolic icon");
create_dir_all(directory).context(CREATE_ICON_DIRECTORY_ERROR)?;
Expand All @@ -147,7 +147,7 @@ fn store_icons(
let size = img.dimensions();

let directory = data.join(format!("icons/hicolor/{}x{}/apps", size.0, size.1));
let filename = directory.join(format!("{}.png", id));
let filename = directory.join(format!("{id}.png"));
create_dir_all(directory).context(CREATE_ICON_DIRECTORY_ERROR)?;
img.save(filename).context(SAVE_ICON_ERROR)?;

Expand All @@ -170,7 +170,7 @@ fn store_icons(
if !required_icon_found {
// Create directory for 48x48 icons in case it does not exist
let directory = data.join("icons/hicolor/48x48/apps");
let filename = directory.join(format!("{}.png", id));
let filename = directory.join(format!("{id}.png"));
create_dir_all(directory).context(CREATE_ICON_DIRECTORY_ERROR)?;

warn!("No required 48x48 icon is provided");
Expand All @@ -184,7 +184,7 @@ fn store_icons(

fn remove_icons(classid: &str, data: &Path) -> Result<()> {
let directory = data.display().to_string();
let pattern = format!("{}/icons/hicolor/*/apps/{}*", directory, classid);
let pattern = format!("{directory}/icons/hicolor/*/apps/{classid}*");

for path in glob(&pattern)?.filter_map(Result::ok) {
let _ = remove_file(path);
Expand Down Expand Up @@ -291,7 +291,7 @@ Exec={exe} site launch {siteid} --url \"{url}\"

fn remove_desktop_entry(classid: &str, data: &Path) -> Result<()> {
let directory = data.join("applications");
let filename = directory.join(format!("{}.desktop", classid));
let filename = directory.join(format!("{classid}.desktop"));

let _ = remove_file(filename);
Ok(())
Expand Down
6 changes: 3 additions & 3 deletions native/src/integrations/implementation/macos.rs
Original file line number Diff line number Diff line change
Expand Up @@ -361,7 +361,7 @@ fn verify_app_is_pwa(app_bundle: &Path, app_id: &str) -> Result<()> {
let mut pkg_info_content = String::new();
pkg_info.read_to_string(&mut pkg_info_content)?;

let pkg_info_id = format!("APPL{}", app_id);
let pkg_info_id = format!("APPL{app_id}");
debug!("Verifying if a bundle is a web app");
debug!("'{}' should be '{}'", pkg_info_content, pkg_info_id);

Expand Down Expand Up @@ -470,7 +470,7 @@ fn create_app_bundle(args: &IntegrationInstallArgs) -> Result<()> {
let info_plist_value: plist::Value = info_plist_dict.into();

plist::to_file_xml(info_plist, &info_plist_value).context(WRITE_APPLICATION_FILE_ERROR)?;
write(pkg_info, format!("APPL{}", appid)).context(WRITE_APPLICATION_FILE_ERROR)?;
write(pkg_info, format!("APPL{appid}")).context(WRITE_APPLICATION_FILE_ERROR)?;

// Create and compile loader executable using Swift compiler
// Swift compiler (swiftc) is part of Command Line Tools for Xcode which is required by Homebrew
Expand Down Expand Up @@ -571,7 +571,7 @@ pub fn launch(site: &Site, url: &Option<Url>, arguments: &[String]) -> Result<Ch
let app_path = directories::BaseDirs::new()
.context(BASE_DIRECTORIES_ERROR)?
.home_dir()
.join(format!("Applications/{}.app", name));
.join(format!("Applications/{name}.app"));

debug!("Verifying that {} is a PWA app bundle", app_path.to_str().unwrap());
match app_path.exists() {
Expand Down

0 comments on commit 14e8473

Please sign in to comment.