u       !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None!exit code for command that ran  stdin for the command to be run stderr for command that ran working directory )print stdout of command that is executed print command that is executed icommand runner, a different runner is used when escaping, probably better to just hold the escaping flag !cache of executables in the PATH "should we trace command execution the trace of command execution (should we exit immediately on any error ShIO is Deprecated in favor of  , which is easier to type. %A monadic-conditional version of the when guard. DMakes a relative path relative to the current Sh working directory. % An absolute path is returned as is. ! To create an absolute path, use  +make the second path relative to the first  Uses /, but will canonicalize the paths if necessary >add a trailing slash to ensure the path indicates a directory makes an absolute path.  Like , but on an exception returns  IObtain a (reasonably) canonic file path to a filesystem object. Based on  canonicalizePath in system-fileio. 8bugfix older version of canonicalizePath (system-fileio <= 0.3.7) loses trailing slash GMake a relative path absolute by combining with the working directory. % An absolute path is returned as is.  To create a relative path, use .  deprecated ,Does a path point to an existing directory?  Does a path point to a symlink? internally log what occurred. # Log will be re-played on failure. ,List directory contents. Does *not* include "." and "..", but it does  include (other) hidden files. )silently uses the Right or Left value of  Filesystem.Path.CurrentOS.toText a print lifted into   a print lifted into   using stderr GEcho text to standard (error, when using _err variants) output. The _n ( variants do not print a final newline. GEcho text to standard (error, when using _err variants) output. The _n ( variants do not print a final newline. GEcho text to standard (error, when using _err variants) output. The _n ( variants do not print a final newline. !GEcho text to standard (error, when using _err variants) output. The _n ( variants do not print a final newline. ")A helper to catch any exception (same as  ...  (e :: SomeException) -> ...). 4 anchor path, the prefix "make this relative to anchor path Left is canonic of second path anchor path, the prefix "make this relative to anchor path anchor path, the prefix "make this relative to anchor path  !"5  !""   !"None#3List directory recursively (like the POSIX utility find). 4 listing is relative if the path given is relative. c If you want to filter out some results or fold over them you can do that with the returned files. F A more efficient approach is to use one of the other find functions. $#+ that filters the found files as it finds. C Files must satisfy the given filter to be returned in the result. %6Fold an arbitrary folding function over files froma a #.  Like $3 but use a more general fold rather than a filter. &#* that filters out directories as it finds b Filtering out directories can make a find much more efficient by avoiding entire trees of files. 'similar $", but also filter out directories  Alternatively, similar to &, but also filter out files > Filtering out directories makes the find much more efficient (like '1 but use a folding function rather than a filter > The most general finder: you likely want a more specific one #$%&'directory filter  file filter  directory (#$%&'(#$%&'(NoneN)9You need to wrap exception handlers with this when using ;. 0Helper to convert a Text to a FilePath. Used by '( /)' and '( .)' ,For the variadic function 0 =partially applied variadic functions require type signatures .8Argument converter for the variadic argument version of c called 0. 5 Useful for a type signature of a function that uses 0 0variadic argument version of c. ! Please see the documenation for c. pThe syntax is more convenient, but more importantly it also allows the use of a FilePath as a command argument. H So an argument can be a Text or a FilePath without manual conversions. 4 a FilePath is automatically converted to Text with . Convenient usage of 0 requires the following: $ {-# LANGUAGE OverloadedStrings #-} ' {-# LANGUAGE ExtendedDefaultRules #-} - {-# OPTIONS_GHC -fno-warn-type-defaults #-}  import Shelly ! import qualified Data.Text as T  default (T.Text) 1Euses System.FilePath.CurrentOS, but can automatically convert a Text 2Euses System.FilePath.CurrentOS, but can automatically convert a Text 5$Transfer from one handle to another ; For example, send contents of a process output to stdout. " does not close the write handle. @Also, return the complete contents being streamed line by line. 6$Transfer from one handle to another ; For example, send contents of a process output to stdout. " does not close the write handle. 9Also, fold over the contents being streamed line by line 7same as , but use it combinator style 9Same as a normal # but specialized for the Sh monad. :Same as a normal  but specialized for the   monad. ;Same as a normal , but specialized for the   monad. <$Catch an exception in the Sh monad. =CChange current working directory of Sh. This does *not* change the G working directory of the process we are running it. Instead, Sh keeps I track of its own working directory and builds absolute paths internally ) instead of passing down relative paths. >=W, execute a Sh action in the new directory and then pop back to the original directory >5, but first create the directory if it does not exit 0apply a String IO operations to a Text FilePath ?EMove a file. The second path could be a directory, in which case the - original file is moved into that directory.  wraps system-fileio *, which may not work across FS boundaries @Get back [Text] instead of [FilePath] A+Obtain the current (Sh) working directory. B=exit 0 means no errors, all other codes are error conditions C&echo a message and exit with status 1 D?for exiting with status > 0 without printing debug information Efail that takes a Text F8Create a new directory (fails if the directory exists). GECreate a new directory, including parents (succeeds if the directory  already exists). HICreate a new directory tree. You can describe a bunch of directories as F a tree and this function will create all subdirectories. An example:  exec = mkTree $  "package" # [  "src" # [ D "Data" # leaves ["Tree", "List", "Set", "Map"]  ], 9 "test" # leaves ["QuickCheck", "HUnit"], % "dist/doc/html" # []  ]  where (#) = Node $ leaves = map (# []) I3Get a full path to an executable by looking at the PATH environement C variable. Windows normally looks in additional places besides the  PATH): this does not duplicate that behavior. Returns # if the precondition is fulfilled. /A monadic findMap, taken from MissingM package J%A monadic-conditional version of the  guard. K4Does a path point to an existing filesystem object? L'Does a path point to an existing file? MKA swiss army cannon for removing things. Actually this goes farther than a K normal rm -rf, as it will circumvent permission problems for the files we  own. Use carefully.  Uses  N9Remove a file. Does not fail if the file does not exist. & Does fail if the file is not a file. ORemove a file. + Does fail if the file does not exist (use N instead) or is not a file. PASet an environment variable. The environment is maintained in Sh D internally, and is passed to any external commands to be executed. Q,add the filepath onto the PATH env variable R4Fetch the current value of an environment variable. 0 if non-existant or empty text, will be Nothing S deprecated TCFetch the current value of an environment variable. Both empty and 7 non-existent variables give empty string as a result. UCFetch the current value of an environment variable. Both empty and @ non-existent variables give the default Text value as a result VECreate a sub-Sh in which external command outputs are not echoed and  commands are not printed.  See Z. WACreate a sub-Sh in which external command outputs are echoed and  Executed commands are printed  See Z. X/Create a sub-Sh with stdout printing on or off  Defaults to True. Y/Create a sub-Sh with command echoing on or off # Defaults to False, set to True by W Z-Enter a sub-Sh that inherits the environment @ The original state will be restored when the sub-Sh completes. % Exceptions are propagated normally. [.Create a sub-Sh where commands are not traced  Defaults to True. D You should only set to False temporarily for very specific reasons \9Create a sub-Sh with shell character escaping on or off.  Defaults to True.  Setting to Falsep allows for shell wildcard such as * to be expanded by the shell along with any other special shell characters.  As a side-effect, setting to False causes changes to PATH to be ignored:  see the c documentation. ])named after bash -e errexit. Defaults to True.  When True., throw an exception on a non-zero exit code.  When False, ignore a non-zero exit code.  Not recommended to set to False: unless you are specifically checking the error code with m. ^)Using this entry point does not create a .shelly directory in the case F of failure. Instead it logs directly into the standard error stream (stderr). _GEnter a Sh from (Monad)IO. The environment and working directories are K inherited from the current process-wide values. Any subsequent changes in G processwide working directory or environment are not reflected in the  running Sh. asame as b, but returns () brun commands over SSH. - An ssh executable is expected in your path. " Commands are in the same form as c, but given as pairs  > sshPairs "server-name" [("cd", "dir"), ("rm",["-r","dir2"])] /This interface is crude, but it works for now. Please note this sets \3 to False: the commands will not be shell escaped. > Internally the list of commands are combined with the string && before given to ssh. cExecute an external command. ' Takes the command name and arguments. You may prefer using 0/ instead, which is a variadic argument version  of this function.  and  are collected. The  is returned as  a result of c?, and complete stderr output is available after the fact using  l 5All of the stdout output will be loaded into memory.  You can avoid this if you don't need stdout by using h, I If you want to avoid the memory and need to process the output then use k or i or j. ,By default shell characters are escaped and ? the command name is a name of a program that can be found via PATH.  Shelly will look through the PATH itself to find the command. When \ is set to False , shell characters are allowed. D Since there is no longer a guarantee that a single program name is " given, Shelly cannot look in the PATH for it.  a PATHI modified by setenv is not taken into account when finding the exe name. & Instead the original Haskell program PATH is used.  On a Posix system the env! command can be used to make the P PATH used when \ is set to False. env echo hello instead of  echo hello d0bind some arguments to run for re-use. Example: + monit = command "monit" ["-c", "monitrc"]  monit ["stop", "program"] ebind some arguments to h for re-use. Example: - monit_ = command_ "monit" ["-c", "monitrc"]  monit_ ["stop", "program"] fHbind some arguments to run for re-use, and require 1 argument. Example: : git = command1 "git" []; git "pull" ["origin", "master"] gHbind some arguments to run for re-use, and require 1 argument. Example: < git_ = command1_ "git" []; git "pull" ["origin", "master"] h the same as c , but return () instead of the stdout content 0 stdout will be read and discarded line-by-line i Similar to c0 but gives the raw stdout handle in a callback. $ If you want even more control, use j. j Similar to c: but gives direct access to all input and output handles. 2Be careful when using the optional input handles. R If you specify Inherit for a handle then attempting to access the handle in your  callback is an error kused by cL. fold over stdout line-by-line as it is read to avoid keeping it in memory [ stderr is still being placed in memory under the assumption it is always relatively small l)The output of last external command. See c. m%The exit code from the last command.  Unless you set ] to False you won'Jt get a chance to use this: a non-zero exit code will throw an exception. n1set the stdin to be used and cleared by the next c. oLPipe operator. set the stdout the first command as the stdin of the second. O This does not create a shell-level pipe, but hopefully it will in the future. * To create a shell level pipe you can set escaping False and use a pipe | character in a command. p)Copy a file, or a directory recursively.  uses q qECopy a file. The second path could be a directory, in which case the 0 original file name is used, in that directory. r@Create a temporary directory and pass it as a parameter to a Sh 1 computation. The directory is nuked afterwards. sWrite a Lazy Text to a file. t=Update a file, creating (a blank file) if it does not exist. uAppend a Lazy Text to a file. wwraps ByteSting readFile xflipped hasExtension for Text y6Run a Sh computation and collect timing information. z&threadDelay wrapper that uses seconds  )*+ ,-./ 012345 6 789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghicommand  arguments stdout handle jcommand  arguments optionally connect process i/o handles to existing handles stdin, stdout and stderr klmnopqrstuvwxyz !"#$%&'({  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{ _^ZVW\XY[]chk0+olnmdefgba,-./ij56 PRTSUQ=>A !7`@KLI12x?ONMqpFGHvwsutrBCDE"9:)*;<34Jyz8#$%&'(v )*+ ,-./ 012345 6 789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz !"#$%&'(NoneZ)/Converter for the variadic argument version of  called . {see ) })This type is a simple wrapper for a type  Shelly.Sh.  } contains a list of results. ~Unpack list of results. "Pack list of results. It performs concat inside }. ;Transform result as list. It can be useful for filtering. see _  Performs  and then an empty action  return (). see ^  Performs  and then an empty action  return (). see Z see \ see X see 'S.print_commands see [ see ] see c see h see k see o see l see n see m see d see e see f see g see b see a see P see R see T see U see Q see = see > see A GEcho text to standard (error, when using _err variants) output. The _n ( variants do not print a final newline. GEcho text to standard (error, when using _err variants) output. The _n ( variants do not print a final newline. GEcho text to standard (error, when using _err variants) output. The _n ( variants do not print a final newline. GEcho text to standard (error, when using _err variants) output. The _n ( variants do not print a final newline. see  see  see 7 see  see ` see  see @ see K see L see  see  see 'S.which see  see  see  see  see  see ? see O see N see M see q see p see F see G see H see    see w see    see    see    see r see # see $ see % see & see ' see   see B see C see D see E see 9 see < see : see y see ; see 3 see 0 y*+),{|}-./012345678~anchor path, the prefix "make this relative to anchor path directory filter  file filter  directory 9:;<=>?@ABCl"+124Jx{|}~l}~+12x"{|4Jt*+),{|}-./012345678~9:;<=>?@ABCD !"#$%&'()*+,-./0123456789:;<=>?@AABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~AA%vuqmnsoprtz{|}~yxgiklhTUX698745N1w2Wbc./`,*+()Vfed]^_;<=>?@YZ[\PSQRJ0OG%DF% shelly-1.3.1Shelly Shelly.Pipe Shelly.Base Filesystem stripPrefix Shelly.Find FileSystemrenameSreadFile writeFile touchFile appendFilefindFoldDirFilterWhenbase Data.Functor<$> Control.Monadunlesswhenprocess-1.1.0.2System.Process.InternalsInherit UseHandle CreatePipe StdStreamsystem-filepath-0.4.7Filesystem.Path.InternalFilePathtransformers-0.3.0.0Control.Monad.IO.ClassliftIO StdHandle ErrorHandle OutHandleInHandleShShIOwhenMrelPath relativeTocanonic canonicalizeabsPathpathtest_dtest_sgettracels toTextIgnoreinspect inspect_errechoecho_necho_err echo_n_errcatchanyfindfindWhenfindFold findDirFilterfindDirFilterWhenfindFoldDirFilter ShellyHandler FoldCallbackShellCmdcmdAllCmdArg toTextArgcmd<.> toTextWarnfromTexttransferLinesAndCombinetransferFoldHandleLinestagputcatch_sh finally_sh catches_sh catchany_shcdchdirmvlsTpwdexit errorExit quietExitterrormkdirmkdir_p mkdirTreewhichunlessMtest_etest_frm_rfrm_frmsetenv appendToPathget_envgetenv get_env_text get_env_defsilently verbosely print_stdoutprint_commandssubtracingescapingerrExit shellyNoDirshelly show_command sshPairs_sshPairsruncommandcommand_command1 command1_run_ runHandle runHandles runFoldLines lastStderr lastExitCodesetStdin-|-cp_rcp withTmpDir writefile touchfile appendfilereadfile readBinaryhasExttimesleepunrollrollliftShshsshsNoDirsCodesStdinsStderr sDirectory sPrintStdoutsPrintCommandssRunsPathExecutablessTracingsTracesErrExitaddTrailingSlashcanonicalizePathControl.Exception.BasecatchState sEnvironmentunShrunSheitherRelativeTomaybeRelativeTounpackgetsmodifylsRelAbs traceLiftIO>=> text-0.11.2.3Data.Text.InternalText ToFilePathfinallyControl.Exceptioncatcheschdir_ppacktoMaybe Data.MaybeJustfindMapMsystem-fileio-0.3.11 removeTreeGHC.IO.Handle.FDstdoutstderrReThrownException QuietExit RunFailed ShellyOpts failToDir toFilePathsearchPathSeparator lineSeqToTextfoldHandleLinesrunCommandNoEscape runCommand shellyProcess setenvRawsetPathpath_env shellyOptsshelly'readDefsurround sshPairs'liftIO_$fShowReThrownException$fExceptionReThrownException$fExceptionQuietExit$fExceptionRunFailed$fShowRunFailed$fToFilePath[]$fToFilePathText$fToFilePathFilePath$fShellCmd(->) $fShellCmdSh $fShellCmdSh0 $fShellCmdSh1 $fCmdArg[]$fCmdArgFilePath $fCmdArgTextShellArg ShellCommandsh0sh1sh2sh3sh4sh0ssh1slift1lift2mapM2$fShellCommand(->)$fShellCommandSh$fShellCommandSh0$fShellCommandSh1$fShellArgFilePath$fShellArgText $fMonadIOSh $fMonadPlusSh$fApplicativeSh $fMonadSh $fFunctorSh