OILS / demo / virtualenv.sh View on Github | oilshell.org

34 lines, 13 significant
1#!/usr/bin/env bash
2#
3# Run scripts generated by Python's virtualenv under osh.
4#
5# Usage:
6# ./virtualenv.sh <function name>
7
8set -o nounset
9set -o pipefail
10set -o errexit
11
12readonly DIR=_tmp/test-venv
13
14create() {
15 virtualenv $DIR
16}
17
18under-bash() {
19 # You can see PS1 change here.
20 bash -i <<EOF
21source $DIR/bin/activate
22echo DONE
23EOF
24}
25
26# Hm there seem to be multiple things that don't work here.
27under-osh() {
28 bin/osh -i <<EOF
29source $DIR/bin/activate
30echo DONE
31EOF
32}
33
34"$@"