aboutsummaryrefslogtreecommitdiffstats
path: root/tw_hooks
diff options
context:
space:
mode:
authorMatthew Lemon <lemon@matthewlemon.com>2020-11-23 20:28:27 +0000
committerMatthew Lemon <lemon@matthewlemon.com>2020-11-23 20:28:27 +0000
commit201caaf75fcd00235dde85cfab1364d1e17e5344 (patch)
treef5aaf5b1e62bc437fdc6524e4dc670e64769092f /tw_hooks
parent6b75ec2a5837698933ea0e0bb758b0b2ffef1479 (diff)
working script
Diffstat (limited to 'tw_hooks')
-rw-r--r--tw_hooks/first_attempt.pl (renamed from tw_hooks/on-add_schedule_tg.pl)0
-rwxr-xr-x[-rw-r--r--]tw_hooks/on-add_scheduled_work_task.pl (renamed from tw_hooks/scratch.pl)11
2 files changed, 8 insertions, 3 deletions
diff --git a/tw_hooks/on-add_schedule_tg.pl b/tw_hooks/first_attempt.pl
index 5423180..5423180 100644
--- a/tw_hooks/on-add_schedule_tg.pl
+++ b/tw_hooks/first_attempt.pl
diff --git a/tw_hooks/scratch.pl b/tw_hooks/on-add_scheduled_work_task.pl
index ec74df3..f9d6a21 100644..100755
--- a/tw_hooks/scratch.pl
+++ b/tw_hooks/on-add_scheduled_work_task.pl
@@ -1,3 +1,5 @@
+#!/bin/env perl
+
use warnings;
use strict;
use feature qw(say);
@@ -49,18 +51,21 @@ if ($decoded_task->{scheduled} and (scalar grep {$_ eq "dft" } @{$tags})) {
if ($ssh->test("ls $work_rem_file") != 1) { die "Cannot find $work_rem_file on $host."};
# If it is there, back it up
- $ssh->system("mv $work_rem_file $work_rem_file.bak");
+ $ssh->system("cp $work_rem_file $work_rem_file.bak");
# Append the Remind formatted line to the original remind file
$ssh->system({stdin_data => $remind_line}, "cat >> ~/.reminders/work.rem") or die "Cannot append text: " . $ssh->error;
# Reset the back up
- $ssh->system("mv $work_rem_file.bak $work_rem_file");
+ # $ssh->system("mv $work_rem_file.bak $work_rem_file");
+ # $decoded_task->{"Description"} = "Cocks";
+ print "Trumpets\n";
print encode_json $decoded_task;
-
+ exit 0;
} else {
print encode_json $decoded_task;
+ exit 0;
}