Fix basics to work on OS X. Still have a few things to go.

This commit is contained in:
Konstantin Nazarov 2021-08-21 19:08:38 +01:00
parent c50d49ec10
commit d1bc231b91
Signed by: knazarov
GPG key ID: 4CFE0A42FA409C22
2 changed files with 3 additions and 3 deletions

View file

@ -230,7 +230,7 @@ unpack_part() {
BOUNDARY=$(echo "$MIME_TYPE" | sed -n 's/^.*boundary="\(.*\)"$/\1/p') BOUNDARY=$(echo "$MIME_TYPE" | sed -n 's/^.*boundary="\(.*\)"$/\1/p')
i=1 i=1
while true; do while true; do
TMP=$(mktemp --tmpdir="$DIR") TMP=$(mktemp "$DIR/tmp.XXXXXXXX")
get_part "$FILE" "$BOUNDARY" "$i" > "$TMP" get_part "$FILE" "$BOUNDARY" "$i" > "$TMP"
((i++)) ((i++))
if [ ! -s "$TMP" ]; then if [ ! -s "$TMP" ]; then
@ -256,7 +256,7 @@ unpack_mime() {
get_headers "$FILE" | grep -v "^Content-Type\|^Content-Disposition\|^Date\|^MIME-Version" >> "$DIR/note.md" get_headers "$FILE" | grep -v "^Content-Type\|^Content-Disposition\|^Date\|^MIME-Version" >> "$DIR/note.md"
echo "" >> "$DIR/note.md" echo "" >> "$DIR/note.md"
TMP=$(mktemp --tmpdir="$DIR") TMP=$(mktemp "$DIR/tmp.XXXXXXXX")
cat "$FILE" > "$TMP" cat "$FILE" > "$TMP"
(unpack_part "$TMP" "$DIR") (unpack_part "$TMP" "$DIR")

View file

@ -231,7 +231,7 @@ resume_editing() {
"$BASE_DIR/notes.sh" -e "$NOTE_ID" 2>/dev/null || true "$BASE_DIR/notes.sh" -e "$NOTE_ID" 2>/dev/null || true
OUTPUT="$(cat "$(pwd)/notes/cur"/*)" OUTPUT="$(cat "$(pwd)/notes/cur"/*)"
assert 'echo "$OUTPUT" | grep myline | wc -l' "1" assert 'echo "$OUTPUT" | grep myline | wc -l | tr -d " "' "1"
cat > "$(pwd)/editor.sh" <<- EOF cat > "$(pwd)/editor.sh" <<- EOF
#!/bin/bash #!/bin/bash