a simple bridge for taskwarrior to ubuntu subsystem on windows.
- install ubuntu: https://www.microsoft.com/store/productId/9NBLGGH4MSV6 follow its instructions in the description
- install taskwarrior: start the ubuntu app, run
sudo apt update && sudo apt install taskwarrior
- test taskwarrior
task
and configure as you wish
npm i -g git+https://github.com/ttschnz/task.git#master
for some reason it opens the .js file in an editor instead of running it via node, so you need to change some things after the installation:
- edit
%appdata%/npm/task.cmd
to:
@ECHO off
SETLOCAL
CALL :find_dp0
IF EXIST "%dp0%\node.exe" (
SET "_prog=%dp0%\node.exe"
) ELSE (
SET "_prog=node"
SET PATHEXT=%PATHEXT:;.JS;=;%
)
"%_prog%" "%dp0%\node_modules\task\bin\main.js" %*
ENDLOCAL
EXIT /b %errorlevel%
:find_dp0
SET dp0=%~dp0
EXIT /b
- edit
%appdata%/npm/task
to
#!/bin/sh
basedir=$(dirname "$(echo "$0" | sed -e 's,\\,/,g')")
case `uname` in
*CYGWIN*|*MINGW*|*MSYS*) basedir=`cygpath -w "$basedir"`;;
esac
if [ -x "$basedir/node" ]; then
"$basedir/node" "$basedir/node_modules/task/bin/main.js" "$@"
ret=$?
else
node "$basedir/node_modules/task/bin/main.js" "$@"
ret=$?
fi
exit $ret
- edit
%appdata%/npm/task.ps1
to
#!/usr/bin/env pwsh
$basedir=Split-Path $MyInvocation.MyCommand.Definition -Parent
$exe=""
if ($PSVersionTable.PSVersion -lt "6.0" -or $IsWindows) {
# Fix case when both the Windows and Linux builds of Node
# are installed in the same directory
$exe=".exe"
}
if (Test-Path "$basedir/node$exe") {
& "$basedir/node$exe" "$basedir/node_modules/task/bin/main.js" $args
$ret=$LASTEXITCODE
} else {
& "node$exe" "$basedir/node_modules/task/bin/main.js" $args
$ret=$LASTEXITCODE
}
exit $ret
- open cmd
- use task command as if you were in the ubuntu subsystem