Comment 22 for bug 1824255

Revision history for this message
Sergio Schvezov (sergiusens) wrote :

To avoid further confusion, this bug is asking for adding environment for what is the `install` hook in my example (through command-chain), but if that is really wanted, just put it in a as seen below

```
sergiusens@gotham:~/projects/snaps/h$ find
.
./refresh
./snap
./snap/snapcraft.yaml
./snap/hooks
./snap/hooks/install
sergiusens@gotham:~/projects/snaps/h$ cat snap/snapcraft.yaml
name: my-snap-name # you probably want to 'snapcraft register <name>'
version: '0.1' # just for humans, typically '1.2+git' or '1.3.2'
summary: Single-line elevator pitch for your amazing snap # 79 char long summary
description: |
  This is my-snap's description. You have a paragraph or two to tell the
  most important story about your snap. Keep it under 100 words though,
  we live in tweetspace and your description wants to look good in the snap
  store.

grade: devel # must be 'stable' to release into candidate/stable channels
confinement: devmode # use 'strict' once you have the right plugs and slots

parts:
  my-part:
    # See 'snapcraft plugins'
    plugin: dump
    source: .
    organize:
      refresh: snap/hooks/refresh
sergiusens@gotham:~/projects/snaps/h$ cat refresh
sergiusens@gotham:~/projects/snaps/h$ cat snap/hooks/install
echo "NO WRAPPERS FOR ME"
sergiusens@gotham:~/projects/snaps/h$ snapcraft prime
This snapcraft project does not specify the base keyword, explicitly setting the base keyword enables the latest snapcraft features.
This project is best built on 'Ubuntu 16.04', but is building on a 'Ubuntu 20.04' host.
Read more about bases at https://docs.snapcraft.io/t/base-snaps/11198
Pulling my-part
Building my-part
Staging my-part
Priming my-part
sergiusens@gotham:~/projects/snaps/h$ cat prime/meta/hooks/refresh
#!/bin/sh
export PATH="$SNAP/usr/sbin:$SNAP/usr/bin:$SNAP/sbin:$SNAP/bin:$PATH"
export LD_LIBRARY_PATH=$SNAP_LIBRARY_PATH:$LD_LIBRARY_PATH
exec "$SNAP/snap/hooks/refresh" "$@"
sergiusens@gotham:~/projects/snaps/h$ cat prime/meta/hooks/install
echo "NO WRAPPERS FOR ME"
```