mirror of
https://github.com/vale981/tridactyl
synced 2025-03-06 01:51:40 -05:00
native_background.ts: Fail if profile couldn't be found on linux
profilecmd.code is not necessarily different from 0 if `find` doesn't return any results. This commit makes sure getProfileDir() checks for such situations.
This commit is contained in:
parent
4734214f9e
commit
aed8338427
1 changed files with 4 additions and 2 deletions
|
@ -460,8 +460,10 @@ export async function getProfileDir() {
|
|||
hacky_profile_finder =
|
||||
"find ../../../Library/'Application Support'/Firefox/Profiles -maxdepth 2 -name .parentlock"
|
||||
let profilecmd = await run(hacky_profile_finder)
|
||||
if (profilecmd.code != 0) {
|
||||
throw new Error("Profile not found")
|
||||
if (profilecmd.code != 0 || profilecmd.content.length == 0) {
|
||||
throw new Error(
|
||||
"Profile not found, please set your 'profiledir' setting.",
|
||||
)
|
||||
} else {
|
||||
// Remove trailing newline
|
||||
profilecmd.content = profilecmd.content.trim()
|
||||
|
|
Loading…
Add table
Reference in a new issue