P6M      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLNone +2346=BK' CA collection of initializers for the three standard process handles#Initialize a handle before using itMexit code for command that ranNstdin for the command to be runOstderr for command that ranPworking directoryQby default, hPutStrLn stdoutR(print stdout of command that is executedSby default, hPutStrLn stderrT(print stderr of command that is executedUprint command that is executedVEinitializers for the standard process handles when running a commandW8when running a command, escape shell characters such as X0 rather than passing to the shell for expansionY cache of executables in the PATHZ!should we trace command execution[the trace of command execution\'should we exit immediately on any errorShIO is Deprecated in favor of , which is easier to type.2A monadic-conditional version of the "when" guard.Makes a relative path relative to the current Sh working directory. An absolute path is returned as is. To create an absolute path, use 1make 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 directorymakes an absolute path. Like , but on an exception returns nObtain a (reasonably) canonic file path to a filesystem object. Based on "canonicalizePath" in system-fileio.^Vbugfix older version of canonicalizePath (system-fileio <= 0.3.7) loses trailing slashMake 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.!dList directory contents. Does *not* include "." and "..", but it does include (other) hidden files."Ksilently uses the Right or Left value of "Filesystem.Path.CurrentOS.toText"#a print lifted into $a print lifted into  using stderr%nEcho text to standard (error, when using _err variants) output. The _n variants do not print a final newline.&nEcho text to standard (error, when using _err variants) output. The _n variants do not print a final newline.'nEcho text to standard (error, when using _err variants) output. The _n variants do not print a final newline.(nEcho 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) -> ...).K`a bcMNOPQRSTUVWdYZ[\efghijklanchor path, the prefix!make this relative to anchor pathLeft is canonic of second pathanchor path, the prefix!make this relative to anchor pathmanchor path, the prefix!make this relative to anchor path]^nop !q"#$%&'(r)stuvwxyDz{ bcMNOPQRSTUVWdYZ[\efghijklm]nop !q"#$%&'()-`a  bcMNOPQRSTUVWdYZ[\efghijklm]^nop !q"#$%&'(r)stuvwxyNone*List directory recursively (like the POSIX utility "find"). listing is relative if the path given is relative. If you want to filter out some results or fold over them you can do that with the returned files. A more efficient approach is to use one of the other find functions.+*m that filters the found files as it finds. Files must satisfy the given filter to be returned in the result.,6Fold an arbitrary folding function over files froma a *. Like +2 but use a more general fold rather than a filter.-* that filters out directories as it finds 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 -Y, but also filter out files Filtering out directories makes the find much more efficient/like .n 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/*+,-./*+,-./None +24:=KM[06Shelly's wrapper around exceptions thrown in its monad29You need to wrap exception handlers with this when using E.|2Helper to convert a Text to a FilePath. Used by '( / )' and '( .)'5For the variadic function 9<partially applied variadic functions require type signatures78Argument converter for the variadic argument version of y called 97. Useful for a type signature of a function that uses 99variadic argument version of y#. Please see the documenation for y.The syntax is more convenient, but more importantly it also allows the use of a FilePath as a command argument. So an argument can be a Text or a FilePath without manual conversions. a FilePath is automatically converted to Text with ".Convenient usage of 9 requires the following: {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE ExtendedDefaultRules #-} {-# OPTIONS_GHC -fno-warn-type-defaults #-} import Shelly import qualified Data.Text as T default (T.Text):Duses System.FilePath.CurrentOS, but can automatically convert a Text;Duses System.FilePath.CurrentOS, but can automatically convert a Text=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.>Transfer from one handle to another For example, send contents of a process output to stdout. does not close the write handle.8Also, fold over the contents being streamed line by line?same as  , but use it combinator styleASame as a normal _" but specialized for the Sh monad.BSame as a normal }" but specialized for the Sh monad.CSame as a normal ~ but specialized for the  monad.ESame as a normal , but specialized for the  monad.F$Catch any exception in the Sh monad.G%Handle any exception in the Sh monad.HChange current working directory of Sh. This does *not* change the working directory of the process we are running it. Instead, Sh keeps track of its own working directory and builds absolute paths internally instead of passing down relative paths.IHV, execute a Sh action in the new directory and then pop back to the original directoryJI4, but first create the directory if it does not exit/apply a String IO operations to a Text FilePathKMove 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 boundariesL%Get back [Text] instead of [FilePath]M*Obtain the current (Sh) working directory.N<exit 0 means no errors, all other codes are error conditionsO%echo a message and exit with status 1P>for exiting with status > 0 without printing debug informationQfail that takes a TextR7Create a new directory (fails if the directory exists).SVCreate a new directory, including parents (succeeds if the directory already exists).TCreate a new directory tree. You can describe a bunch of directories as a tree and this function will create all subdirectories. An example: 8exec = mkTree $ "package" # [ "src" # [ "Data" # leaves ["Tree", "List", "Set", "Map"] ], "test" # leaves ["QuickCheck", "HUnit"], "dist/doc/html" # [] ] where (#) = Node leaves = map (# [])U3Get a full path to an executable by looking at the PATHR environement 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 packageV%A monadic-conditional version of the  guard.W3Does a path point to an existing filesystem object?X&Does a path point to an existing file?Y3Test that a file is in the PATH and also executableZA swiss army cannon for removing things. Actually this goes farther than a normal rm -rf, as it will circumvent permission problems for the files we own. Use carefully. Uses [^Remove a file. Does not fail if the file does not exist. Does fail if the file is not a file.\:Remove a file. Does fail if the file does not exist (use [ instead) or is not a file.]Set an environment variable. The environment is maintained in Sh internally, and is passed to any external commands to be executed.^+add the filepath onto the PATH env variable`get the full environmentacFetch the current value of an environment variable. if non-existant or empty text, will be Nothingb deprecatedcyFetch the current value of an environment variable. Both empty and non-existent variables give empty string as a result.dFetch the current value of an environment variable. Both empty and non-existent variables give the default Text value as a resultePApply a single initializer to the two output process handles (stdout and stderr)f[Apply a single initializer to all three standard process handles (stdin, stdout and stderr)gWhen running an external command, apply the given initializers to the specified handles for that command. This can for example be used to change the encoding of the handles or set them into binary mode.heCreate a sub-Sh in which external command outputs are not echoed and commands are not printed. See o.ieCreate a sub-Sh in which external command outputs are echoed and Executed commands are printed See o.jBCreate a sub-Sh in which stdout is sent to the user-defined loggerkBCreate a sub-Sh in which stderr is sent to the user-defined loggerlACreate a sub-Sh with stdout printing on or off Defaults to True.mACreate a sub-Sh with stderr printing on or off Defaults to True.nRCreate a sub-Sh with command echoing on or off Defaults to False, set to True by ioEnter a sub-Sh that inherits the environment The original state will be restored when the sub-Sh completes. Exceptions are propagated normally.pCreate a sub-Sh where commands are not traced Defaults to True. You should only set to False temporarily for very specific reasonsqFCreate a sub-Sh with shell character escaping on or off. Defaults to True. Setting to False 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 y documentation.r)named after bash -e errexit. Defaults to True. When True4, 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 .sDeprecated now, just use uL, whose default has been changed. Using this entry point does not create a .shelly] directory in the case of failure. Instead it logs directly into the standard error stream (stderr).t!Using this entry point creates a .shelly= directory in the case of failure where errors are recorded.uEnter a Sh from (Monad)IO. The environment and working directories are inherited from the current process-wide values. Any subsequent changes in processwide working directory or environment are not reflected in the running Sh.wsame as x, but returns ()xfrun commands over SSH. An ssh executable is expected in your path. Commands are in the same form as y, 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 qq to False: the commands will not be shell escaped. Internally the list of commands are combined with the string && before given to ssh.yCExecute an external command. Takes the command name and arguments.You may prefer using 9A instead, which is a variadic argument version of this function. and  are collected. The  is returned as a result of y@, and complete stderr output is available after the fact using kAll of the stdout output will be loaded into memory. You can avoid this if you don't need stdout by using ~K, If you want to avoid the memory and need to process the output then use  or  or .kBy 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 q is set to False, shell characters are allowed. Since there is no longer a guarantee that a single program name is given, Shelly cannot look in the PATH for it. a PATHo 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 ] PATH used when q is set to False. env echo hello instead of  echo helloz/bind some arguments to run for re-use. Example: Cmonit = command "monit" ["-c", "monitrc"] monit ["stop", "program"]{bind some arguments to ~ for re-use. Example: Fmonit_ = command_ "monit" ["-c", "monitrc"] monit_ ["stop", "program"]|Gbind some arguments to run for re-use, and require 1 argument. Example: 8git = command1 "git" []; git "pull" ["origin", "master"]}Gbind some arguments to run for re-use, and require 1 argument. Example: :git_ = command1_ "git" []; git "pull" ["origin", "master"]~ the same as y , but return ()N instead of the stdout content stdout will be read and discarded line-by-line Similar to yT but gives the raw stdout handle in a callback. If you want even more control, use . Similar to y9 but gives direct access to all input and output handles.Be careful when using the optional input handles. If you specify Inherit for a handle then attempting to access the handle in your callback is an errorused by y. 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)The output of last external command. See y.5The exit code from the last command. Unless you set r[ to False you won't get a chance to use this: a non-zero exit code will throw an exception.1set the stdin to be used and cleared by the next y.Pipe operator. set the stdout the first command as the stdin of the second. 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./Copy a file, or a directory recursively. uses tCopy a file. The second path could be a directory, in which case the original file name is used, in that directory.pCreate a temporary directory and pass it as a parameter to a Sh computation. The directory is nuked afterwards.Write a Text to a file.<Update a file, creating (a blank file) if it does not exist.Append a Text to a file.wraps ByteSting readFileflipped hasExtension for Text5Run a Sh computation and collect timing information.%threadDelay wrapper that uses seconds=spawn an asynchronous action with a copy of the current state01234|56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~command arguments stdout handlecommand arguments:optionally connect process i/o handles to existing handlesstdin, stdout and stderr out handle in handle&should it be printed while transfered?filepath conversiontracing statementconverted filepath  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~ustohiqlmngprjky~94z{|}xw5678=> ef]acbd`_^HIJM%&'(#$? v!LWXYU:;K\[ZRSTNOPQD)ABGC23EF01"< V@*+,-./01234|56789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~None+234:=HIKMnObtain a (reasonably) canonic file path to a filesystem object. Based on "canonicalizePath" in system-fileio.command arguments stdout handlecommand arguments:optionally connect process i/o handles to existing handlesstdin, stdout and stderranchor path, the prefix!make this relative to anchor path "*+,-./456789:;>Vstuvust945678>v:;" V*+,-./xNone 24:=KM\/Converter for the variadic argument version of  called L.see 2)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 u Performs  and then an empty action  return (). see t Performs  and then an empty action  return ().see osee qsee jsee ksee lsee 'S.print_commandssee psee rsee ysee ~see see see see see see z see { see | see } see x see wsee ]see asee csee dsee ^see Hsee Isee MnEcho text to standard (error, when using _err variants) output. The _n variants do not print a final newline.nEcho text to standard (error, when using _err variants) output. The _n variants do not print a final newline.nEcho text to standard (error, when using _err variants) output. The _n variants do not print a final newline.nEcho text to standard (error, when using _err variants) output. The _n variants do not print a final newline.see #see $see ?see  see vsee ! see L!see W"see X#see $see % see 'S.which&see 'see (see )see *see +see K,see \-see [.see Z/see 0see 1see R2see S3see T4see  5see 6see  7see  8see  9see :see *;see +<see ,=see ->see .?see  @see NAsee OBsee PCsee QDsee AEsee FFsee CGsee Hsee EIsee <Lsee 9|      !"#$%&'()*anchor path, the prefix!make this relative to anchor path+,-./0123456789:;<=>directory filter file filter directory?@ABCDEFGHIJKLn ")4:;V      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLn4L      !"#$%&:;'()*+,-./0123456879@ABC)DFHE"I VGJK:;<=>?w      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKL !"#$$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIIJJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~V`a9ST8WXYZ[\]^_bcdefghijklnopqrstuwxz>?@A0123467:<=BJJ-txz{u_`d>A@?<=V9:cno67l42301bsrqijkCDEFGHefghX]Z\S8WP-      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOMO-PQRSTUVWXYZ[\]^_`abcdef shelly-1.6.2Shelly Shelly.Lifted Shelly.Pipe Shelly.Base Filesystem stripPrefix Shelly.Find FileSystemrenameSreadFile writeFile touchFile appendFilefindFoldDirFilterWhenbase Data.Functor<$> Control.Monadunlesswhentransformers-0.4.3.0Control.Monad.IO.ClassliftIOprocess-1.2.0.0System.Process.InternalsInherit UseHandle CreatePipe StdStreamsystem-filepath-0.4.13.3Filesystem.Path.InternalFilePathFilesystem.Path.CurrentOSfromTextStdInitinInitoutIniterrInitHandleInitializer StdHandle ErrorHandle OutHandleInHandleShShIOwhenMrelPath relativeTocanonic canonicalizeabsPathpathtest_dtest_sgettracels toTextIgnoreinspect inspect_errechoecho_necho_err echo_n_errcatchanyfindfindWhenfindFold findDirFilterfindDirFilterWhenfindFoldDirFilterReThrownException ShellyHandler FoldCallbackShellCmdcmdAllCmdArg toTextArgcmd<.> toTextWarntransferLinesAndCombinetransferFoldHandleLinestagputcatch_sh handle_sh finally_sh bracket_sh catches_sh catchany_sh handleany_shcdchdirchdir_pmvlsTpwdexit errorExit quietExitterrormkdirmkdir_p mkdirTreewhichunlessMtest_etest_ftest_pxrm_rfrm_frmsetenv appendToPathget_environment get_env_allget_envgetenv get_env_text get_env_definitOutputHandlesinitAllHandlesonCommandHandlessilently verboselylog_stdout_withlog_stderr_with print_stdout print_stderrprint_commandssubtracingescapingerrExit shellyNoDir shellyFailDirshelly show_command sshPairs_sshPairsruncommandcommand_command1 command1_run_ runHandle runHandles runFoldLines lastStderr lastExitCodesetStdin-|-cp_rcp withTmpDir writefile touchfile appendfilereadfile readBinaryhasExttimesleepasyncShMonadShliftShunrollrollshs shsFailDirsCodesStdinsStderr sDirectory sPutStdout sPrintStdout sPutStderr sPrintStderrsPrintCommandssInitCommandHandlessCommandEscapingGHC.Num*sPathExecutablessTracingsTracesErrExitaddTrailingSlashcanonicalizePathControl.Exception.BasecatchEmptyFilePathErrorState sEnvironment sReadOnly ReadOnlyState rosFailToDirunShrunSheitherRelativeTomaybeRelativeTounpackgetsmodifylsRelAbs traceLiftIO$fExceptionEmptyFilePathError$fShowEmptyFilePathError $fMonadMaskSh$fMonadCatchSh$fMonadThrowSh$fMonadBaseControlIOSh$fMonadBaseIOSh>=> text-1.2.0.4Data.Text.InternalText ToFilePathhandlefinallyControl.ExceptioncatchespacktoMaybe Data.MaybeJustfindMapMsystem-fileio-0.3.16.2 removeTreeGHC.IO.Handle.FDstdoutstderr QuietExit RunFailed toFilePathsearchPathSeparator lineSeqToTextfilterIOErrorsfoldHandleLinesrunCommandNoEscape runCommand shellyProcess isExecutable setenvRawsetPathpath_envdefReadOnlyStateshelly'readDefsurround sshPairs'liftIO_putHandleIntoMVar tracePath traceAbsPathtraceCanonicPath$fShowReThrownException$fExceptionReThrownException$fExceptionQuietExit$fExceptionRunFailed$fShowRunFailed$fToFilePath[]$fToFilePathText$fToFilePathFilePath$fShellCmd(->)$fShellCmd(->)0 $fShellCmdSh $fShellCmdSh0 $fShellCmdSh1 $fCmdArg[]$fCmdArgFilePath $fCmdArgTextMonadShControlShM liftShWith restoreSh StRWSTShMRWSTShM ReaderTShM StStateTShM StateTShM ErrorTShM StWriterTShM WriterTShM IdentityTShM MaybeTShMListTShMShSh controlShTFCo:R:ShMRWSTa$fMonadShControlRWSTTFCo:R:ShMRWSTa0$fMonadShControlRWST0TFCo:R:ShMReaderTa$fMonadShControlReaderTTFCo:R:ShMStateTa$fMonadShControlStateTTFCo:R:ShMStateTa0$fMonadShControlStateT0TFCo:R:ShMErrorTa$fMonadShControlErrorTTFCo:R:ShMWriterTa$fMonadShControlWriterTTFCo:R:ShMWriterTa0$fMonadShControlWriterT0TFCo:R:ShMIdentityTa$fMonadShControlIdentityTTFCo:R:ShMMaybeTa$fMonadShControlMaybeTTFCo:R:ShMListTa$fMonadShControlListT TFCo:R:ShMSha$fMonadShControlSh $fShellCmdm $fShellCmdm0 $fShellCmdm1 $fMonadShRWST$fMonadShRWST0$fMonadShWriterT$fMonadShWriterT0$fMonadShStateT$fMonadShStateT0$fMonadShReaderT$fMonadShErrorT$fMonadShContT$fMonadShMaybeT$fMonadShListT$fMonadShIdentityT $fMonadShShShellArg ShellCommandsh0sh1sh2sh3sh4sh0ssh1slift1lift2mapM2$fShellCommand(->)$fShellCommandSh$fShellCommandSh0$fShellCommandSh1$fShellArgFilePath$fShellArgText $fMonadIOSh $fMonadPlusSh$fAlternativeSh$fApplicativeSh $fMonadSh $fFunctorSh