diff --git a/README.md b/README.md index f9e6e85..dd131e8 100644 --- a/README.md +++ b/README.md @@ -43,9 +43,19 @@ tailing `$TMPDIR/q`. ```sh qq() { clear - local gpath="${GOPATH:-$HOME/go}" - "${gpath%%:*}/src/github.com/y0ssar1an/q/q.sh" "$@" + + logpath="$TMPDIR/q" + if [[ -z "$TMPDIR" ]]; then + logpath="/tmp/q" + fi + + if [[ ! -f "$logpath" ]]; then + echo 'Q LOG' > "$logpath" + fi + + tail -100f -- "$logpath" } + rmqq() { if [[ -f "$TMPDIR/q" ]]; then rm "$TMPDIR/q" diff --git a/q.sh b/q.sh deleted file mode 100755 index 1728e01..0000000 --- a/q.sh +++ /dev/null @@ -1,20 +0,0 @@ -#!/usr/bin/env bash -set -euo pipefail - -logfile="q" -logpath="$TMPDIR/$logfile" - -if [[ -z "$TMPDIR" ]]; then - if [[ -e "/system/bin/adb" ]]; then - # android - logpath="/data/local/tmp/$logfile" - else - logpath="/tmp/$logfile" - fi -fi - -if [[ ! -f "$logpath" ]]; then - echo 'Q LOG' > "$logpath" -fi - -tail -100f -- "$logpath"