Skip to content

Commit

Permalink
fix: only check if in flatpak
Browse files Browse the repository at this point in the history
fix: a bit more reliable checking function
  • Loading branch information
GeopJr committed Mar 20, 2022
1 parent a01ff44 commit cffe248
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions src/modules/functions/file_set.cr
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,9 @@ module Collision
end

def real_path(filepath : Path) : String | Nil
parts = filepath.parts
return nil if (parts - ["run", "user", "doc"]).size == parts.size - 3
{% if !env("FLATPAK_ID").nil? || file_exists?("/.flatpak-info") %}
return nil if filepath.parents.includes?(Path["/", "run", "user"])
{% end %}
filepath.dirname.to_s
end

Expand Down

0 comments on commit cffe248

Please sign in to comment.