Browse Source

cleaning up temp files

master
mort 8 years ago
parent
commit
d98c983261
2 changed files with 8 additions and 2 deletions
  1. 2
    0
      bin/med
  2. 6
    2
      bin/mshot

+ 2
- 0
bin/med View File

@@ -5,3 +5,5 @@ TMP_FILE=$(mktemp /tmp/med.XXXXXXXXXX)
cat - > "$TMP_FILE"
vim "$TMP_FILE" < /dev/tty > /dev/tty
cat "$TMP_FILE" > /dev/stdout

rm "$TMP_FILE"

+ 6
- 2
bin/mshot View File

@@ -1,13 +1,14 @@
#!/bin/bash

OS=$(uname)
ECODE=0

if [ "$1" = "" ]; then
echo "mshot <name>"
fi

sleep 0.2
DIR=$(mktemp -d /tmp/mupload.XXXXXXXXXX)
DIR=$(mktemp -d /tmp/mshot.XXXXXXXXXX)

if [ "$OS" = "Darwin" ]; then
screencapture "$DIR/pic.png"
@@ -21,5 +22,8 @@ if [ $? -eq 0 ]; then
else
merror "mshot" "Couldn't upload image file."
echo "An error occurred." 1>&2
exit 1
ECODE=1
fi

rm -r "$DIR"
exit "$ECODE"

Loading…
Cancel
Save