1
0
Fork 0
mirror of https://we.phorge.it/source/arcanist.git synced 2024-11-28 01:32:41 +01:00
phorge-arcanist/support/shell/hooks/bash-completion.sh
epriestley ccd1ebb256 Port "arc prompts" from wilds and fix a path issue in shell completion
Summary:
Ref T13490. Bring "arc prompts" from "wilds" and hook it into the prompt in "arc shell-complete".

See D21069. Fix an issue where the shell hook tested for a path other than the path it writes to.

Test Plan: Ran "arc shell-complete" with no hook and got a prompt. Shell completed things. Ran "arc prompts shell-complete".

Maniphest Tasks: T13490

Differential Revision: https://secure.phabricator.com/D21085
2020-04-11 10:43:05 -07:00

10 lines
379 B
Bash

SCRIPTDIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" > /dev/null && pwd )"
GENERATED_RULES_FILE="${SCRIPTDIR}/../rules/bash-rules.sh"
# Try to generate the shell completion rules if they do not yet exist.
if [ ! -f "${GENERATED_RULES_FILE}" ]; then
arc shell-complete --generate >/dev/null 2>/dev/null
fi;
# Source the shell completion rules.
source "${GENERATED_RULES_FILE}"