Documentation ¶
Overview ¶
Package fileutil contains code to work with shell files, also known as shell scripts.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HasShebang ¶
HasShebang reports whether bs begins with a valid sh or bash shebang. It supports variations with /usr and env.
Types ¶
type ScriptConfidence ¶
type ScriptConfidence int
ScriptConfidence defines how likely a file is to be a shell script, from complete certainty that it is not one to complete certainty that it is one.
const ( ConfNotScript ScriptConfidence = iota ConfIfShebang ConfIsScript )
func CouldBeScript ¶
func CouldBeScript(info os.FileInfo) ScriptConfidence
CouldBeScript reports how likely a file is to be a shell script. It discards directories, symlinks, hidden files and files with non-shell extensions.
Click to show internal directories.
Click to hide internal directories.