mirror of
https://github.com/go-task/task.git
synced 2026-09-01 19:50:16 +02:00
refactor(completion): move the shell test harness out of completion/
Packaging globs completion/ into the release archives, so the harness added alongside the engine was about to ship run.sh and five wrapper scripts to every user. The previous commit worked around it by listing the packaged directories one by one, which quietly stops packaging any shell added later. Moving the harness to testdata/completion/ leaves completion/ holding only what we ship, so the glob can go back to completion/**/* and needs no maintenance when a shell is added.
This commit is contained in:
@@ -43,12 +43,7 @@ archives:
|
||||
files:
|
||||
- README.md
|
||||
- LICENSE
|
||||
- completion/bash/*
|
||||
- completion/fish/*
|
||||
- completion/nu/*
|
||||
- completion/ps/*
|
||||
- completion/zsh/*
|
||||
- completion/legacy/**/*
|
||||
- completion/**/*
|
||||
format_overrides:
|
||||
- goos: windows
|
||||
formats: [zip]
|
||||
|
||||
@@ -164,8 +164,9 @@ tasks:
|
||||
- internal/complete/**/*.go
|
||||
- cmd/task/**/*.go
|
||||
- completion/**/*
|
||||
- testdata/completion/*
|
||||
cmds:
|
||||
- bash completion/tests/run.sh
|
||||
- bash testdata/completion/run.sh
|
||||
|
||||
goreleaser:test:
|
||||
desc: Tests release process without publishing
|
||||
|
||||
@@ -22,7 +22,7 @@ _filedir() { CAP+="filedir:$* cur=$cur"$'\n'; }
|
||||
compopt() { CAP+="compopt:$*"$'\n'; }
|
||||
__ltrim_colon_completions() { :; }
|
||||
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/../bash/task.bash"
|
||||
source "$(dirname "${BASH_SOURCE[0]}")/../../completion/bash/task.bash"
|
||||
|
||||
run() {
|
||||
CAP=""
|
||||
@@ -3,7 +3,7 @@
|
||||
# Set up by run.sh: TASK_FIXTURE, and `task` on PATH = the binary under test.
|
||||
|
||||
cd $TASK_FIXTURE
|
||||
source (dirname (status -f))/../fish/task.fish
|
||||
source (dirname (status -f))/../../completion/fish/task.fish
|
||||
|
||||
set -g fails 0
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
# Set up by run.sh: $env.TASK_FIXTURE, and `task` on PATH = the binary under test.
|
||||
|
||||
# `source` needs a parse-time constant path.
|
||||
const TASK_NU = (path self "../nu/task-completions.nu")
|
||||
const TASK_NU = (path self "../../completion/nu/task-completions.nu")
|
||||
|
||||
# Installed before the wrapper is sourced, to assert the delegation path.
|
||||
$env.config.completions.external.completer = {|spans| [{ value: $"prev:($spans | first)" }] }
|
||||
@@ -3,7 +3,7 @@
|
||||
# the binary under test.
|
||||
|
||||
Set-Location $env:TASK_FIXTURE
|
||||
. "$PSScriptRoot/../ps/task.ps1"
|
||||
. "$PSScriptRoot/../../completion/ps/task.ps1"
|
||||
|
||||
$fails = 0
|
||||
|
||||
@@ -29,7 +29,7 @@ _files() { CAP+="files:$*"$'\n' }
|
||||
_path_files() { CAP+="path_files:$*"$'\n' }
|
||||
|
||||
# Sourcing avoids the autoload first-call quirk; `compdef` is stubbed above.
|
||||
source ${0:A:h}/../zsh/_task
|
||||
source ${0:A:h}/../../completion/zsh/_task
|
||||
|
||||
run() {
|
||||
CAP=""
|
||||
Reference in New Issue
Block a user