Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions python/openshell/release_formula_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -113,6 +113,15 @@ def test_snap_wrapper_uses_optional_gateway_config_without_generating_toml() ->
assert 'exec "${SNAP}/bin/openshell-gateway" "$@"' in wrapper


def test_snap_cli_uses_snap_owned_xdg_dirs() -> None:
repo_root = Path(__file__).resolve().parents[2]
snapcraft = (repo_root / "snapcraft.yaml").read_text(encoding="utf-8")

assert snapcraft.count('XDG_CONFIG_HOME: "$SNAP_USER_COMMON/.config"') == 2
Comment thread
pimlock marked this conversation as resolved.
Outdated
assert snapcraft.count('XDG_DATA_HOME: "$SNAP_USER_COMMON/.local/share"') == 2
assert snapcraft.count('XDG_STATE_HOME: "$SNAP_USER_COMMON/.local/state"') == 2


def test_rpm_spec_uses_gateway_defaults_without_config_helper() -> None:
repo_root = Path(__file__).resolve().parents[2]
spec = (repo_root / "openshell.spec").read_text(encoding="utf-8")
Expand Down
8 changes: 8 additions & 0 deletions snapcraft.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ platforms:
apps:
openshell:
command: bin/openshell
environment:
XDG_CONFIG_HOME: "$SNAP_USER_COMMON/.config"
XDG_DATA_HOME: "$SNAP_USER_COMMON/.local/share"
XDG_STATE_HOME: "$SNAP_USER_COMMON/.local/state"
plugs:
- home
- network
Expand All @@ -70,6 +74,10 @@ apps:
term:
command: bin/openshell term
desktop: meta/gui/term.desktop
environment:
XDG_CONFIG_HOME: "$SNAP_USER_COMMON/.config"
XDG_DATA_HOME: "$SNAP_USER_COMMON/.local/share"
XDG_STATE_HOME: "$SNAP_USER_COMMON/.local/state"
plugs:
- home
- network
Expand Down
Loading