forked from mozilla-necko/meeting-notes
-
Notifications
You must be signed in to change notification settings - Fork 0
/
update
executable file
·52 lines (39 loc) · 1.4 KB
/
update
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
#!/bin/bash
# This Source Code Form is subject to the terms of the Mozilla Public
# License, v. 2.0. If a copy of the MPL was not distributed with this
# file, You can obtain one at https://mozilla.org/MPL/2.0/.
# Author: Manuel Bucher <[email protected]>
# Date: 2023-01-10
# Requirements:
#
# * python
# * curl
# * pandoc
#
# Uses the latest download from the Download folder to extract the public
# meeting notes from. The format should be docx, because of
# https://stackoverflow.com/a/24896746, but odt works as well.
set -euxo pipefail
# Use last downloaded file for meeting notes. If there is a newer file use `touch` on the
# meeting notes to convert
DOWNLOAD_DIR="$HOME/Downloads"
INPUT_FILE="$DOWNLOAD_DIR/$(ls -Art $DOWNLOAD_DIR | tail -n 1)"
# Convert to markdown
pandoc --wrap=none -t commonmark_x -i "${INPUT_FILE}" -o "meeting-notes.0.md"
# extract part between "--- public ---" and "--- private ---"
./extract meeting-notes.0.md
# Regenerate index of meeting notes
./summary > archive/SUMMARY.md
# Add new files for next commit
git add archive/
# Show diff to commit for review
git diff --staged --color=always | less -R
# Write commit message, but ask for confirmation
git commit -m "Add meeting notes" -e
# show the commit for last review before pushing
git --no-pager show HEAD
# https://stackoverflow.com/a/1885542
read -p "upload changes? [y/N]?" CONT
if [ "$CONT" = "y" ]; then
git push
fi