You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
functionparseShebang(fileText){// based on https://github.com/pnpm/cmd-shim// see also https://github.com/npm/cmd-shim// examples:// "#!/bin/sh" -> ["/bin/sh", ""]// "#! /usr/bin/bash a b c" -> ["/usr/bin/bash", " a b c"]// "#! /usr/bin/env -S bash a b c" -> ["bash", " a b c"]// "#! /usr/bin/env -Sbash a b c" -> ["bash", " a b c"]constshebangExpr=/^#!\s*(?:\/usr\/bin\/env\s+(?:-S)?)?\s*(\S+)(.*)$/;letfirstLineEnd=fileText.indexOf('\n');if(firstLineEnd==-1)firstLineEnd=fileText.length;constfirstLine=fileText.slice(0,firstLineEnd).trimRight();constshebang=firstLine.match(shebangExpr);if(!shebang)returnnull;const[_,arg0,args]=shebang;return[arg0,args];}
The text was updated successfully, but these errors were encountered:
actual
expected
man env
currently, these shebang parsers fail
related issues
quickfix
The text was updated successfully, but these errors were encountered: