瀏覽代碼

cleaning up temp files

master
mort 8 年之前
父節點
當前提交
d98c983261
共有 2 個檔案被更改,包括 8 行新增2 行删除
  1. 2
    0
      bin/med
  2. 6
    2
      bin/mshot

+ 2
- 0
bin/med 查看文件

cat - > "$TMP_FILE" cat - > "$TMP_FILE"
vim "$TMP_FILE" < /dev/tty > /dev/tty vim "$TMP_FILE" < /dev/tty > /dev/tty
cat "$TMP_FILE" > /dev/stdout cat "$TMP_FILE" > /dev/stdout

rm "$TMP_FILE"

+ 6
- 2
bin/mshot 查看文件

#!/bin/bash #!/bin/bash


OS=$(uname) OS=$(uname)
ECODE=0


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


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


if [ "$OS" = "Darwin" ]; then if [ "$OS" = "Darwin" ]; then
screencapture "$DIR/pic.png" screencapture "$DIR/pic.png"
else else
merror "mshot" "Couldn't upload image file." merror "mshot" "Couldn't upload image file."
echo "An error occurred." 1>&2 echo "An error occurred." 1>&2
exit 1
ECODE=1
fi fi

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

Loading…
取消
儲存