File tree Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Expand file tree Collapse file tree 1 file changed +4
-10
lines changed Original file line number Diff line number Diff line change 49
49
50
50
#!/usr/bin/env bash
51
51
52
- if [[ ! -t 0 && "${BASH_SOURCE[0]}" == "$0" ]]; then
52
+ if [[ ! -t 0 ]]; then
53
53
echo "🧪 Terdeteksi: dijalankan via pipe (| bash)"
54
54
exit 2
55
55
elif [[ -t 0 && "${BASH_SOURCE[0]}" == "$0" ]]; then
56
56
echo "🧑 Interaktif: dijalankan langsung (bash script.sh)"
57
57
exit 3
58
- elif [[ -n "${BASH_SOURCE[0]}" ]]; then
58
+ elif [[ -z "${BASH_SOURCE[0]}" ]]; then
59
59
echo "📦 Terdeteksi: dijalankan via source"
60
60
exit 4
61
61
fi
171
171
IFS=$'\n' read -d '' -r -a file_list < <(ls -Art ~/bin/*.sh)
172
172
IFS=$'\n' read -d '' -r -a file_list < <(printf "%s\n" "${file_list[@]}" | xargs -n1 basename)
173
173
174
- if [ ! -t 0 ]; then
175
- echo "[error] This script requires an interactive terminal (tty)." >&2
176
- return 1
177
- fi
174
+
178
175
179
176
select weapon in "${file_list[@]}" "EXIT"; do
180
177
{
262
259
echo -e "Info : $a_href
263
260
Author: <adharudin14@gmail.com>"
264
261
printf %"$(tput cols)"s | tr " " "-"
265
- if [ ! -t 0 ]; then
266
- echo "[error] This script requires an interactive terminal (tty)."
267
- exit 1
268
- fi
262
+
269
263
select filename in Exit "Add repository and termux-url-opener plugin" "Fix issue if any" ${files};
270
264
do
271
265
[[ -n $filename ]] || { echo "$warn :What's that? Please try again." >&2; continue; }
You can’t perform that action at this time.
0 commit comments