This is to install/update the Firefox Dev edition. There is no package for it (afaik).
There should be a better solution than this (like use Arch Linux). At this moment it deletes the folder and will nuke user data. Be careful if you want to use this. Or just don't use it.
- Separate files: main.go, fetch.go, verify.go, install.go.
- Profiles/data: do not store user data in /opt; use $HOME/.mozilla/firefox.
- Cache dir: ensure userCacheDir() creates it and use consistently.
- Atomic install: create temp dir as sibling of installDir, not inside it.
- State file: ensure atomic write + fsync; copyStateAtomic() is okay.
- Permissions: review 0700/0755 for temp dirs and final install.
- Flags: install requires --cache; verify requires --tarball & --sig.
- Error handling: return errors, avoid log.Fatal inside functions.
- Extraction: handle tar.xz safely, preserve symlinks and permissions.
- Optional improvements: symlink-based versioning for easy rollback.