diff --git a/openfpga.sh b/openfpga.sh index 690a7b9b9..88eaed7c2 100755 --- a/openfpga.sh +++ b/openfpga.sh @@ -5,9 +5,9 @@ #author : Ganesh Gore #============================================================================== -export OPENFPGA_PATH="$(pwd)" -export OPENFPGA_SCRIPT_PATH="$(pwd)/openfpga_flow/scripts" -export OPENFPGA_TASK_PATH="$(pwd)/openfpga_flow/tasks" +export OPENFPGA_PATH=$(dirname $(readlink -f $0)) +export OPENFPGA_SCRIPT_PATH="${OPENFPGA_PATH}/openfpga_flow/scripts" +export OPENFPGA_TASK_PATH="${OPENFPGA_PATH}/openfpga_flow/tasks" if [ -z $PYTHON_EXEC ]; then export PYTHON_EXEC="python3"; fi # This function checks the path and @@ -44,7 +44,7 @@ run-flow () { # lists all the configure task in task directory list-tasks () { check_execution_path "$(pwd)" - ls -tdalh ${OPENFPGA_TASK_PATH}/* | awk '{printf("%-4s | %s %-3s | ", $5, $6, $7) ;system("basename " $9)}' + tree -P 'task.conf' --prune | sed "/.* task.conf/d" | sed "/.* config/d" | sed '$d' } # Switch directory to root of OpenFPGA @@ -58,15 +58,6 @@ run-regression-local () { bash .github/workflows/*reg_test.sh } -# Run regression test locally -run-regression-local-docker () { - cd ${OPENFPGA_PATH} - docker run \ - -v $(pwd)/openfpga_flow:/opt/openfpga/ \ - -v $(pwd)/.github:/opt/openfpga/ \ - ghcr.io/lnis-uofu/openfpga-master:latest "bash .github/workflows/*reg_test.sh" -} - # Changes directory to task directory [goto_task ] goto-task () { if [ -z $1 ]; then @@ -105,7 +96,12 @@ unset-openfpga (){ if [[ $(ps -p $$ -oargs=) == *"zsh"* ]]; then autoload -U +X bashcompinit; bashcompinit; fi -TaskList=$(ls -tdalh ${OPENFPGA_TASK_PATH}/* | awk '{system("basename " $9)}' | awk '{printf("%s ",$1)}') +# TaskList=$(ls -tdalh ${OPENFPGA_TASK_PATH}/* | awk '{system("basename " $9)}' | awk '{printf("%s ",$1)}') +TaskList=$(ls -tdalh ${OPENFPGA_TASK_PATH}/**/task.conf | +awk '{print $9}' | sed -e "s/\/config\/task.conf//" | +sed -e "s/${OPENFPGA_PATH//\//\\/}\/openfpga_flow\/tasks\///" | +awk '{printf("%s ",$1)}') + complete -W "${TaskList}" goto-task complete -W "${TaskList}" run-task complete -W "${TaskList}" run-shell-task