#!/bin/sh # `cfsh` on PATH, opening shuttle. # # The whole of it is a forward to `cf sh`, and that is the point: `bin/cf` # works out which labs checkout to run from $PWD, and `exec` does not change # the working directory, so both hops agree on which checkout they mean without # this file knowing anything about checkouts. A second copy of that lookup here # would be a second thing to keep in step -- $CF_LABS_ROOT, the walk up past a # vendored labs, symlinks walked by hand because `readlink -f` is not on a # stock macOS -- and it would drift. # # Pick it up the way `cf` is picked up: `deno task install-cf` installs this # beside `cf`. # # Being a forward is also what lets a copy of this file work anywhere: it finds # `cf` by name, so it depends on PATH and on nothing about where it sits. set -e if ! command -v cf >/dev/null 2>&1; then echo "cfsh: no \`cf\` on PATH, and \`cf sh\` is what this runs." >&2 echo " Put one there with 'deno task install-cf' from a labs checkout." >&2 exit 127 fi exec cf sh "$@"