File: env.script

package info (click to toggle)
cmdtest 0.32-3
  • links: PTS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 540 kB
  • sloc: python: 1,358; sh: 220; makefile: 2
file content (24 lines) | stat: -rwxr-xr-x 500 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#!/bin/sh

set -eu

cat << 'EOF' > "$DATADIR/env.yarn"
    SCENARIO check environment
    THEN DATADIR is set
    AND SRCDIR is set
    AND NOTSET is not set
    AND HOME is prefixed by DATADIR

    IMPLEMENTS THEN (\S+) is set
    env
    env | grep "^$MATCH_1="

    IMPLEMENTS THEN (\S+) is not set
    ! env | grep "^$MATCH_1="

    IMPLEMENTS THEN (\S+) is prefixed by (\S+)
    x=$(env | sed -n "/^$MATCH_2=/s///p")
    env | grep "^$MATCH_1=$x/"
EOF

NOTSET=foo ./run-yarn "$DATADIR/env.yarn"