Skip to content

Commit

Permalink
Merge pull request #2 from r0ei/patch-1
Browse files Browse the repository at this point in the history
Fixed index out of range error
  • Loading branch information
mxrch authored Mar 26, 2021
2 parents 44acebc + 21b4e9b commit 00a2fbb
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions webwrap.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,11 @@
reg = """\]LEDEBUT\]([\s\S]*)\]LAFIN\]"""

req = httpx.get(host.replace("WRAP", "echo -n ]LEDEBUT]$(whoami)[$(hostname)[$(pwd)]LAFIN]"))
prefixes = re.compile(reg).findall(req.text)[0].split("[")
path = prefixes[2]
prefixes = re.compile(reg).findall(req.text)
if not prefixes:
print("Req.text not found!\n")
exit(-1)
path = prefixes[0].split("[")[2]
prefix = colored(prefixes[0] + "@" + prefixes[1], "red") + ":" + colored(prefixes[2], "cyan") + "$ "
print("")

Expand Down

0 comments on commit 00a2fbb

Please sign in to comment.