chainguard-dev / chainguard-dev/tw

tw/commands: add a new command to get free port

Open
#39 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Go
Stars
2
Forks
36
Avg merge
4h 36m
Merged PRs (30d)
6

Description

Current workaround are:

  • ${FREE_PORT}
  • PORT=$(for p in $(shuf -i 30000-40000 -n 10); do (echo > /dev/tcp/127.0.0.1/$p) >/dev/null 2>&1 || { echo $p; break; }; done)

This command should check whether the selected PORT is actually FREE or not. If its not, it should iterate over.

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by inspecting the existing commands under tw/commands and how new commands are registered. Check the current command tests, if present, then implement the requested command so it checks the selected port and iterates when that port is occupied; done means the command returns a free port.

Written by the indexing model from the issue text.

Assessment

Tech stack
go
Domain
cli
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.