Skip to content

Commit 163b553

Browse files
committed
chore: 포트 종료 명령어 추가
1 parent b3b9f8c commit 163b553

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

justfile

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,17 @@ generate-env:
7878
go-test:
7979
go list -f '{{{{.Dir}}' -m | xargs -I {} go test {}/...
8080

81+
kill-port port:
82+
#!/usr/bin/env bash
83+
set -euo pipefail
84+
pid=$(ss -tlnp | grep ":{{ port }} " | sed -n 's/.*pid=\([0-9]*\).*/\1/p' | head -1)
85+
if [ -n "$pid" ]; then
86+
echo "Killing process $pid on port {{ port }}"
87+
kill -9 $pid
88+
else
89+
echo "No process found on port {{ port }}"
90+
fi
91+
8192
lint target="all":
8293
#!/usr/bin/env bash
8394
set -euox pipefail

0 commit comments

Comments
 (0)