Skip to content

Commit

Permalink
chore: log snap installation method (#539)
Browse files Browse the repository at this point in the history
Signed-off-by: Callahan Kovacs <[email protected]>
  • Loading branch information
mr-cal authored Oct 22, 2024
1 parent 384153d commit 33bc6f6
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions craft_application/services/provider.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,10 +102,20 @@ def setup(self) -> None:
# use the aliased name of the snap when injecting
name = os.getenv("SNAP_INSTANCE_NAME", self._app.name)
channel = None
emit.debug(
f"Setting {self._app.name} to be injected from the "
"host into the build environment because it is running "
"as a snap."
)
else:
# use the snap name when installing from the store
name = self._app.name
channel = os.getenv("CRAFT_SNAP_CHANNEL", "latest/stable")
emit.debug(
f"Setting {self._app.name} to be installed from the {channel} "
"channel in the build environment because it is not running "
"as a snap."
)

self.snaps.append(Snap(name=name, channel=channel, classic=True))

Expand Down

0 comments on commit 33bc6f6

Please sign in to comment.