feat!: Remove Paver
BREAKING CHANGE: Removes all remaining Paver commands including `pavelib/prereqs.py:*` and `pavelib/assets.py:*`. BREAKING CHANGE: Removes `./manage.py [lms|cms] compile_sass`, which was just a wrapper around Paver commands. BREAKING CHANGE: Removes paver.txt. Operators should install testing.txt instead. Part of: https://github.com/openedx/edx-platform/issues/34467
This commit is contained in:
committed by
Kyle McCormick
parent
38dc4eab5d
commit
2d5543a9ae
@@ -1,89 +0,0 @@
|
||||
# shellcheck disable=all
|
||||
# ^ Paver in edx-platform is on the way out
|
||||
# (https://github.com/openedx/edx-platform/issues/31798)
|
||||
# so we're not going to bother fixing these shellcheck
|
||||
# violations.
|
||||
|
||||
# Courtesy of Gregory Nicholas
|
||||
|
||||
_subcommand_opts()
|
||||
{
|
||||
local awkfile command cur usage
|
||||
command=$1
|
||||
cur=${COMP_WORDS[COMP_CWORD]}
|
||||
awkfile=/tmp/paver-option-awkscript-$$.awk
|
||||
echo '
|
||||
BEGIN {
|
||||
opts = "";
|
||||
}
|
||||
|
||||
{
|
||||
for (i = 1; i <= NF; i = i + 1) {
|
||||
# Match short options (-a, -S, -3)
|
||||
# or long options (--long-option, --another_option)
|
||||
# in output from paver help [subcommand]
|
||||
if ($i ~ /^(-[A-Za-z0-9]|--[A-Za-z][A-Za-z0-9_-]*)/) {
|
||||
opt = $i;
|
||||
# remove trailing , and = characters.
|
||||
match(opt, "[,=]");
|
||||
if (RSTART > 0) {
|
||||
opt = substr(opt, 0, RSTART);
|
||||
}
|
||||
opts = opts " " opt;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
END {
|
||||
print opts
|
||||
}' > $awkfile
|
||||
|
||||
usage=`paver help $command`
|
||||
options=`echo "$usage"|awk -f $awkfile`
|
||||
|
||||
COMPREPLY=( $(compgen -W "$options" -- "$cur") )
|
||||
}
|
||||
|
||||
|
||||
_paver()
|
||||
{
|
||||
local cur prev
|
||||
COMPREPLY=()
|
||||
# Variable to hold the current word
|
||||
cur="${COMP_WORDS[COMP_CWORD]}"
|
||||
prev="${COMP_WORDS[COMP_CWORD - 1]}"
|
||||
|
||||
# Build a list of the available tasks from: `paver --help --quiet`
|
||||
local cmds=$(paver -hq | awk '/^ ([a-zA-Z][a-zA-Z0-9_]+)/ {print $1}')
|
||||
|
||||
subcmd="${COMP_WORDS[1]}"
|
||||
# Generate possible matches and store them in the
|
||||
# array variable COMPREPLY
|
||||
|
||||
if [[ -n $subcmd ]]
|
||||
then
|
||||
|
||||
if [[ ${#COMP_WORDS[*]} == 3 ]]
|
||||
then
|
||||
_subcommand_opts $subcmd
|
||||
return 0
|
||||
else
|
||||
if [[ "$cur" == -* ]]
|
||||
then
|
||||
_subcommand_opts $subcmd
|
||||
return 0
|
||||
else
|
||||
COMPREPLY=( $(compgen -o nospace -- "$cur") )
|
||||
fi
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ${#COMP_WORDS[*]} == 2 ]]
|
||||
then
|
||||
COMPREPLY=( $(compgen -W "${cmds}" -- "$cur") )
|
||||
fi
|
||||
}
|
||||
|
||||
# Assign the auto-completion function for our command.
|
||||
|
||||
complete -F _paver -o default paver
|
||||
Reference in New Issue
Block a user