question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Description

In many places there’s the assumption that if the OS is not macOS, then it’s Windows. An example can be found at app/src/lib/editors/lookup.ts:

const menuItemName = __DARWIN__ ? 'Preferences' : 'Options'

I think an assumption like this one it’s okay, because I’m not aware of a cross-de conventions about which name to use for settings 😁.

But in other places, it’s less great. The real “issue” for me it’s “Explorer”. For example, in app/src/ui/changes/no-changes.tsx:

const opener = __DARWIN__ ? 'Finder' : 'Explorer'

I don’t think there’s a fast way to synchronously get the default file manager name on Linux.

Visual Studio Code, for example, avoids this issue saying Open Containing Folder, I don’t know what it shows for macOS and Windows.

Maybe your File Manager could be just fine.

Version

GitHub Desktop version: [1.0.5-test1]

OS version: [Fedora 26]

Steps to Reproduce

Expected behavior: [What you expected to happen]

Actual behavior: [What actually happened]

Reproduces how often: [What percentage of the time does it reproduce?]

Logs

Additional Information

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:5
  • Comments:5 (5 by maintainers)

github_iconTop GitHub Comments

1reaction
niikcommented, Nov 20, 2017

I might be in the minority here, but I still see these solutions as heavier than the problem itself. Conditionals are a bummer, but trading them for more complexity isn’t a net win, I don’t think.

💯

Let’s not overthink this until it becomes a problem for real (l18n). For now adding one more condition seems like the most straightforward approach to the problem that this issue is referring to.

const opener = __DARWIN__ ? 'Finder' : 
               __WINDOWS__ ? 'Explorer' :
               'your File Manager'
0reactions
joshabercommented, Nov 20, 2017

I might be in the minority here, but I still see these solutions as heavier than the problem itself. Conditionals are a bummer, but trading them for more complexity isn’t a net win, I don’t think.

Read more comments on GitHub >

github_iconTop Results From Across the Web

GNU/Linux naming controversy - Wikipedia
Proponents of the term Linux argue that it is far more commonly used by the public and media and that it serves as...
Read more >
Linux file System and Naming Convention Explained
This tutorial explains the Linux file system (Linux directory structure) and the naming convention in detail. Learn how Linux organizes the ...
Read more >
Best practice for naming files in Linux | InMotion Hosting
Its possible you have named the files not case sensitive This article will explain the best practice for naming files on Linux.
Read more >
Linux / UNIX: Rules For Naming File And Directory Names
All file names are case sensitive. · You can use upper and lowercase letters, numbers, “.” (dot), and “_” (underscore) symbols. · You...
Read more >
Linux device naming - IBM
This topic provides information to help you understand naming patterns for devices on Linux. Special device files are used by kernel drivers to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found