Skip to content

Commit 4dc7139

Browse files
Copilotsebst
andauthored
Add taskwarrior.org feature (#179)
* Initial plan * Add taskwarrior.org feature Co-authored-by: sebst <592313+sebst@users.noreply.github.com> Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/07b0f3d7-9e75-46df-8f68-a7ec0e4ed328 * Fix test: task --version outputs just the version number, not 'task x.y.z' Co-authored-by: sebst <592313+sebst@users.noreply.github.com> Agent-Logs-Url: https://github.com/devcontainer-community/devcontainer-features/sessions/e6343737-136f-4f45-ab84-a9a7d304c939 --------- Co-authored-by: copilot-swe-agent[bot] <198982749+Copilot@users.noreply.github.com> Co-authored-by: sebst <592313+sebst@users.noreply.github.com>
1 parent c62d99e commit 4dc7139

5 files changed

Lines changed: 88 additions & 0 deletions

File tree

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -62,6 +62,7 @@
6262
| [starship.rs](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/starship.rs) | `starship` — minimal, fast cross-shell prompt | gh release | 1.0.1 |
6363
| [swc.rs](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/swc.rs) | `swc` — ultra-fast JS/TS compiler | gh release | 1.0.0 |
6464
| [tailscale.com](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/tailscale.com) | `tailscale` — zero-config mesh VPN | curl | 1.0.0 |
65+
| [taskwarrior.org](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/taskwarrior.org) | `task` — command-line task manager | apt | 1.0.0 |
6566
| [webinstall.dev](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/webinstall.dev) | `webi` — install packages without sudo | curl | 1.0.1 |
6667
| [yakitrak/notesmd-cli](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/yakitrak-notesmd-cli) | `notesmd-cli` — manage Obsidian vaults from the terminal | gh release | 1.0.0 |
6768
| [yq](https://github.com/devcontainer-community/devcontainer-features/tree/main/src/yq) | `yq` — command-line YAML/JSON/XML processor | gh release | 1.0.0 |

src/taskwarrior.org/NOTES.md

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
# taskwarrior.org
2+
3+
## Project
4+
5+
- [taskwarrior](https://taskwarrior.org)
6+
7+
## Description
8+
9+
Command-line task management tool with filtering and reporting capabilities.
10+
11+
## Installation Method
12+
13+
Installed via the system APT package manager (`apt-get install taskwarrior`).
14+
15+
## Other Notes
16+
17+
_No additional notes._
Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
{
2+
"name": "taskwarrior.org",
3+
"id": "taskwarrior.org",
4+
"version": "1.0.0",
5+
"description": "Install \"task\" binary",
6+
"documentationURL": "https://github.com/devcontainer-community/devcontainer-features/tree/main/src/taskwarrior.org",
7+
"options": {
8+
"version": {
9+
"type": "string",
10+
"default": "latest",
11+
"proposals": [
12+
"latest"
13+
],
14+
"description": "Currently unused. taskwarrior is installed via the system package manager."
15+
}
16+
}
17+
}

src/taskwarrior.org/install.sh

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
#!/bin/bash
2+
set -o errexit
3+
set -o pipefail
4+
set -o noclobber
5+
set -o nounset
6+
set -o allexport
7+
readonly name="taskwarrior"
8+
apt_get_update() {
9+
if [ "$(find /var/lib/apt/lists/* | wc -l)" = "0" ]; then
10+
echo "Running apt-get update..."
11+
apt-get update -y
12+
fi
13+
}
14+
apt_get_checkinstall() {
15+
if ! dpkg -s "$@" >/dev/null 2>&1; then
16+
apt_get_update
17+
DEBIAN_FRONTEND=noninteractive apt-get -y install --no-install-recommends --no-install-suggests --option 'Debug::pkgProblemResolver=true' --option 'Debug::pkgAcquire::Worker=1' "$@"
18+
fi
19+
}
20+
apt_get_cleanup() {
21+
apt-get clean
22+
rm -rf /var/lib/apt/lists/*
23+
}
24+
echo_banner() {
25+
local text="$1"
26+
echo -e "\e[1m\e[97m\e[41m$text\e[0m"
27+
}
28+
install() {
29+
apt_get_checkinstall taskwarrior
30+
apt_get_cleanup
31+
}
32+
echo_banner "devcontainer.community"
33+
echo "Installing $name..."
34+
install "$@"
35+
echo "(*) Done!"

test/taskwarrior.org/test.sh

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
#!/bin/bash
2+
3+
4+
set -e
5+
6+
# Optional: Import test library bundled with the devcontainer CLI
7+
# See https://github.com/devcontainers/cli/blob/HEAD/docs/features/test.md#dev-container-features-test-lib
8+
# Provides the 'check' and 'reportResults' commands.
9+
source dev-container-features-test-lib
10+
11+
# Feature-specific tests
12+
# The 'check' command comes from the dev-container-features-test-lib. Syntax is...
13+
# check <LABEL> <cmd> [args...]
14+
check "execute command" bash -c "task --version | grep -E '[0-9]+\.[0-9]+'"
15+
16+
# Report results
17+
# If any of the checks above exited with a non-zero exit code, the test will fail.
18+
reportResults

0 commit comments

Comments
 (0)