Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 25 additions & 6 deletions .github/workflows/ci.shellcode.yml
Original file line number Diff line number Diff line change
Expand Up @@ -339,18 +339,14 @@ jobs:
no-shell-output-if-no-tty:
needs: compile
runs-on: ubuntu-latest
container:
image: archlinux:latest # lazygit fails for reasons that are mysterious
options: -t
steps:
- uses: actions/download-artifact@v3
with:
path: /usr/local/bin
name: tea

- name: prep
run: |
chmod u+x /usr/local/bin/tea
run: chmod u+x /usr/local/bin/tea

#TODO ideally we'd test something that uses another tool in tea and
# is poorly written so it reads both stdout and stderr eg `lazygit`
Expand All @@ -361,6 +357,29 @@ jobs:
tea echo 2> >(tee temp_file) >/dev/null
if [[ -s temp_file ]]; then
echo
echo 'tea output logging info when no tty present'
echo 'tea output logging info when no tty present' >&2
exit 1
fi

cannot-multi-dev:
needs: compile
runs-on: ubuntu-latest
steps:
- uses: actions/download-artifact@v3
with:
path: /usr/local/bin
name: tea
- name: prep
run: chmod u+x /usr/local/bin/tea

- run: echo '{}' > package.json

- run: |
eval "$(tea --shellcode)"

dev

if dev; then
echo 'dev did not fail when already activated' >&2
exit 1
fi
3 changes: 3 additions & 0 deletions src/modes/shellcode.ts
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,9 @@ export default function() {
dev() {
if [ "$1" = 'off' ]; then
_tea_deactivate
elif type _tea_deactivate >/dev/null 2>&1; then
echo 'dev: environment already active' >&2
return 1
else
eval "$(command tea --internal.activate "$PWD" "$@")"
fi
Expand Down