See how a minor change to your commit message style can make you a better programmer.
Format: <type>(<scope>): <subject>
<scope> is optional
| # Opens a PowerShell instance with elevation, finds the wsl ip without relying on hostname, since ArchWSL and others doesn't have it | |
| # then iterate opening the selected ports | |
| $principal = New-Object Security.Principal.WindowsPrincipal([Security.Principal.WindowsIdentity]::GetCurrent()) | |
| if($principal.IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)) { | |
| $remoteport = wsl -- ip -o -4 -json addr list eth0 ` | ConvertFrom-Json ` | %{ $_.addr_info.local } ` | ?{ $_ } | |
| $found = $remoteport -match '\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}'; | |
| if($found) { | |
| $remoteport = $matches[0]; | |
| } else{ |
| #!/bin/bash | |
| set -e | |
| # insert a line to a file if the line does not already exist | |
| # - first parameter is the file to insert the line | |
| # - second parameter is the line to insert. It'll only be inserted if not already exists | |
| # - third parameter is optional. This will override the search behavior. | |
| # Instead of searching for the line of parameter 2 this term is used. | |
| function insertLineIfNotExists { | |
| FILE=$1 |