Warn if profile is not found.

This commit is contained in:
Oliver Blanthorn 2018-04-30 15:36:34 +01:00
parent 20efdea685
commit 8951cd0219
No known key found for this signature in database
GPG key ID: 2BB8C36BB504BFF3
2 changed files with 5 additions and 1 deletions

View file

@ -198,6 +198,7 @@ export async function guiset(rule: string, option: string) {
return
}
} else profile_dir = config.get("profiledir")
if (profile_dir == "") {logger.error("Profile not found."); return}
await Native.mkdir(profile_dir + "/chrome", true)
let cssstr = (await Native.read(profile_dir + "/chrome/userChrome.css")).content
// this will get overwritten as soon as a second command is run.

View file

@ -165,7 +165,10 @@ export async function getProfileDir() {
if ((await browser.runtime.getPlatformInfo()).os === "mac")
hacky_profile_finder =
"find ../../../Library/'Application Support'/Firefox/Profiles -maxdepth 2 -name .parentlock"
return (await run(hacky_profile_finder)).content
let profilecmd = await run(hacky_profile_finder)
if (profilecmd.code != 0) {
return ""
} else return profilecmd.content
.split("/")
.slice(0, -1)
.join("/")