Crate snapcraft

Crate snapcraft 

Source

Functionsยง

check_snap_home
Checks to see whether we are running within a snap, and if so return the real home directory for the current user.
in_snap
Checks whether we are running within a snap
snap
Directory where the snap is mounted. This is where all the files in your snap are visible in the filesystem. All of the data in the snap is read-only and cannot be changed.
snap_arch
CPU architecture of the running system. Typical value amd64
snap_common
Directory for system data that is common across revisions of a snap. This directory is owned and writable by root and is meant to be used by background applications (daemons, services). Unlike SNAP_DATA this directory is not backed up and restored across snap refresh and revert operations.
snap_data
Directory for system data of a snap. This directory is owned and writable by root and is meant to be used by background applications (daemons, services). Unlike SNAP_COMMON this directory is backed up and restored across snap refresh and snap revert operations.
snap_env
A map of all of the environment variables that start with SNAP_
snap_instance_key
Instance key if one was set during installation or empty (snapd 2.36+). For example instance hello-world_foo has an instance key foo.
snap_instance_name
The name of snap instance, including instance key if one is set (snapd 2.36+). For example snap hello-world with instance key foo has instance name equal to hello-world_foo.
snap_library_path
Directory with additional system libraries. This variable is used internally by snapcraft. The value is always /var/lib/snapd/lib/gl: Please note the colon at the end of that value, the variable is a colon-separated list.
snap_name
The name of the snap as specified in the snapcraft.yaml file.
snap_real_home
The vanilla HOME environment variable before snapd-induced remapping, refer Any way to acquire the originally set HOME environment variable? - snapcraft snapcraft.io for more info.
snap_revision
Revision of the snap, as allocated by the Snap Store on upload or as allocated by snapd for locally installed snaps. The Snap Store assigns monotonic revisions to each upload of a given snap. Snapd uses Snap Store revisions if accompanying assertions are available or uses a locally generated number. Locally generated numbers are prefixed with x to distinguish them from Snap Store uploads.
snap_save_data
This variable is only exposed on Ubuntu Core systems, and was introduced with snapd 2.57. It points to a snap-specific location on the ubuntu-save partition where the snap is allowed to store persistent files (like certificates or configuration files) that will survive a factory reset of the Ubuntu Core device.
snap_user_common
Directory for user data that is common across revisions of a snap. Unlike SNAP_DATA, data present in this directory is not backed up or restored across snap refresh and snap revert operations. The directory is suitable for large data that the application can access even if it was made or modified by a future version of a snap.
snap_user_data
Directory for user data. This directory is backed up and restored across snap refresh and snap revert operations. Typical value: /home/zyga/snap/hello-world/27
snap_version
The version string as specified in the snapcraft.yaml