jschlatow / taskopen

Tool for taking notes and open urls with taskwarrior
GNU General Public License v2.0
364 stars 31 forks source link

malformed JSON string... #84

Closed gour closed 11 years ago

gour commented 11 years ago

Hello,

I'm very happy seeing improved taskopen script and it was the main reason to switch back from orgmode to Taskwarrior, but have problem with it on my Debian (Sid) task running tw-2.0.0.

Here are short snippets showing the problem...

task> long test

ID  Project Pri Added      Started Due Recur Countdown Age Deps Tags Description                 
111             17.4.2013.                 -           32s           testopen
                                                                       17.4.2013. ~/asciidoc.txt

Attempt to open it:

[gour@atmarama gour] taskopen 111                                                                                                                                                                                                    ~
sh: 2: Configuration: not found
sh: 3: Configuration: not found
malformed JSON string, neither array, object, number, string or atom, at character offset 1 (before "ID  Project Pri Due ...") at /usr/local/bin/taskopen line 791, <CONFIG> line 21.

Here is the part of my .taskrc:

editor=nano
alias.open=execute /usr/local/bin/taskopen

and .taskopenrc:

#!/bin/bash

BROWSER='/usr/bin/firefox'
EDITOR='/bin/nano'
TASKBIN='/usr/bin/task'

# If you sync tasks FOLDER should be a location that syncs and is available to
# other computers, i.e. /users/dropbox/tasknotes
# FOLDER to store notes in, must already exist!
FOLDER="~/tasknotes/"

# Preferred extension for tasknotes
EXT=".txt"

# Message that gets annotated to the task to indicate that notes exist
NOTEMSG="Notes"

# Command that opens notes. UUID will be replaced with the actual uuid of 
# the task.
# Default is: $EDITOR ${FOLDER}UUID$EXT
NOTES_CMD="$EDITOR ${FOLDER}UUID$EXT"

I see that the offending line is:

my @decoded_json = @{decode_json("$json")};

but no idea where it fails.

jschlatow commented 11 years ago

Any chance you can update to a taskwarrior version >= 2.1.x? Taskopen doesn't really work with taskwarrior 2.0 (see https://github.com/ValiValpas/taskopen/issues/75#issuecomment-14933085).

gour commented 11 years ago

Thank you. Somehow I missed that issue. :-(

Installed new TW from 'experimental' and everything is fine now. :-)

Thanks a lot for working on taskopen - it's a feature deserved to be part of the core. ;)