-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTaskfile.yml
More file actions
160 lines (133 loc) · 3.89 KB
/
Taskfile.yml
File metadata and controls
160 lines (133 loc) · 3.89 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
version: '3'
tasks:
default:
desc: Show available tasks
cmds:
- task --list
copy:
desc: Copy plugin.js to clipboard (for pasting into Thymer)
cmds:
- cat plugin.js | wl-copy
- echo "plugin.js copied to clipboard"
copy-json:
desc: Copy plugin.json to clipboard
cmds:
- cat plugin.json | wl-copy
- echo "plugin.json copied to clipboard"
copy-all:
desc: Copy both plugin.js and plugin.json (js first, then json)
cmds:
- cat plugin.js | wl-copy
- echo "plugin.js copied - paste it, then press Enter to copy plugin.json"
- read
- cat plugin.json | wl-copy
- echo "plugin.json copied to clipboard"
test:
desc: Create test markdown file and copy to clipboard
cmds:
- |
cat <<'EOF' | wl-copy
# Heading 1
## Heading 2 with **bold**
Regular paragraph with **bold**, *italic*, and `code`.
- Bullet one
- Bullet with **formatting**
1. First item
2. Second item
> Blockquote text
- [ ] Unchecked task
- [x] Checked task
```javascript
function hello() {
return "world";
}
```
Final paragraph.
EOF
- echo "Test markdown copied to clipboard"
commit:
desc: Git add, commit with message, and push
cmds:
- git add .
- git commit -m "{{.CLI_ARGS}}"
- git push
status:
desc: Show git status
cmds:
- git status
log:
desc: Show recent git log
cmds:
- git log --oneline -10
# Server tasks
build:
desc: Build the tm server binary
dir: server
cmds:
- go build -o tm .
- echo "Built server/tm"
install:
desc: Install tm binary to ~/.local/bin
deps: [build]
cmds:
- mkdir -p ~/.local/bin
- cp server/tm ~/.local/bin/tm
- chmod +x ~/.local/bin/tm
- echo "Installed to ~/.local/bin/tm"
- echo "Make sure ~/.local/bin is in your PATH"
service:install:
desc: Install systemd user service for tm server
cmds:
- mkdir -p ~/.config/systemd/user
- mkdir -p ~/.local/share/thymer-paste/logs
- |
cat > ~/.config/systemd/user/thymer-paste.service << 'EOF'
[Unit]
Description=Thymer Paste Bridge Server
After=network.target
[Service]
Type=simple
ExecStart=%h/.local/bin/tm server
Restart=on-failure
RestartSec=5
StandardOutput=append:%h/.local/share/thymer-paste/logs/server.log
StandardError=append:%h/.local/share/thymer-paste/logs/server.log
[Install]
WantedBy=default.target
EOF
- systemctl --user daemon-reload
- systemctl --user enable thymer-paste.service
- echo "Service installed and enabled"
- echo "Run 'task service:start' to start it"
service:start:
desc: Start the tm server service
cmds:
- systemctl --user start thymer-paste.service
- echo "Service started"
- systemctl --user status thymer-paste.service --no-pager
service:stop:
desc: Stop the tm server service
cmds:
- systemctl --user stop thymer-paste.service
- echo "Service stopped"
service:restart:
desc: Restart the tm server service
cmds:
- systemctl --user restart thymer-paste.service
- echo "Service restarted"
service:status:
desc: Show tm server service status
cmds:
- systemctl --user status thymer-paste.service --no-pager
service:logs:
desc: Show tm server logs
cmds:
- tail -f ~/.local/share/thymer-paste/logs/server.log
service:uninstall:
desc: Stop and remove the systemd service
cmds:
- systemctl --user stop thymer-paste.service || true
- systemctl --user disable thymer-paste.service || true
- rm -f ~/.config/systemd/user/thymer-paste.service
- systemctl --user daemon-reload
- echo "Service removed"