github.com/upcmd/up@v0.8.1-0.20230108151705-ad8b797bf04f/examples/0001/01/up.yml (about)

     1  tasks:
     2  
     3    -
     4      name: Main
     5      desc: |
     6        please switch to use case1|case2 ...
     7        the reason we do not chain all cases together is because
     8        the venv will pollute the entire running session unless you mananage to restore it
     9      task:
    10        -
    11          func: call
    12          do: case2
    13  
    14    -
    15      name: case1
    16      desc: |
    17      task:
    18        -
    19          func: shell
    20          desc: |
    21            before sourcing, the env var: AAA does not exist
    22            this will cause an error
    23          do:
    24            - env |grep AAA
    25          flags:
    26            - ignoreError
    27  
    28        -
    29          func: cmd
    30          desc: |
    31            case1: only source
    32            source via the source content
    33          do:
    34            - name: virtualEnv
    35              cmd:
    36                source: |
    37                  echo "start of source"
    38                  export AAA=sourced_aaa
    39                  echo "end of source"
    40  
    41        -
    42          func: shell
    43          desc: |
    44            after sourcing, the env var: AAA exist
    45          do:
    46            - env |grep AAA
    47  
    48    -
    49      name: case2
    50      desc: |
    51      task:
    52        -
    53          func: shell
    54          desc: |
    55            before sourcing, the env var: AAA does not exist
    56            this will cause an error
    57          do:
    58            - env |grep AAA
    59          flags:
    60            - ignoreError
    61  
    62        -
    63          func: cmd
    64          desc: |
    65            case2: only source
    66            source via srcfile
    67          do:
    68            - name: virtualEnv
    69              cmd:
    70                srcfile: ./test_env.rc
    71        -
    72          func: shell
    73          desc: |
    74            after sourcing, the env var: AAA exist
    75          do:
    76            - env |grep AAA
    77