Sa      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_` Safe-Infereda stdin for the command to be run b)print stdout of command that is executed cprint command that is executed FMakes a relative path relative to the current ShIO 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 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. GMake a relative path absolute by combining with the working directory. % An absolute path is returned as is.  To create a relative path, use . ,Does a path point to an existing directory?  Does a path point to a symlink? internally log what occured. # 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 ShIO &a print lifted into ShIO 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  ... d (e :: SomeException) -> ...). #efgahibcjklmanchor 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 nanchor path, the prefix "make this relative to anchor path  op q'rsefgahibcjklmn op qe fgahibcjklmn op q Safe-Infered3List 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 directory filter  file filter  Safe-Infered6"You need this when using -. $"variadic argument version of run. q 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. & a FilePath is converted to Text with . 4 You will need to add the following to your module: $ {-# LANGUAGE OverloadedStrings #-} ' {-# LANGUAGE ExtendedDefaultRules #-} - {-# OPTIONS_GHC -fno-warn-type-defaults #-}  import Shelly  import Data.Text.Lazy as LT  default (LT.Text) %Euses System.FilePath.CurrentOS, but can automatically convert a Text &Euses System.FilePath.CurrentOS, but can automatically convert a Text )same as , but use it combinator style +&Catch an exception in the ShIO monad. ,&Catch an exception in the ShIO monad. --Catch multiple exceptions in the ShIO monad. .&Catch an exception in the ShIO monad. /EChange current working directory of ShIO. This does *not* change the I working directory of the process we are running it. Instead, ShIO keeps I track of its own working directory and builds absolute paths internally C instead of passing down relative paths. This may have performance D repercussions if you are doing hundreds of thousands of filesystem N operations. You will want to handle these issues differently in those cases. 0cdY, execute a ShIO action in the new directory and then pop back to the original directory 1 Currently a  renameFile) wrapper. TODO: Support cross-filesystem F move. TODO: Support directory paths in the second parameter, like in cp. 2Get back [Text] instead of [FilePath] 3-Obtain the current (ShIO) working directory. 6fail that takes a Text 78Create a new directory (fails if the directory exists). 8ECreate a new directory, including parents (succeeds if the directory  already exists). 9$Get a full path to an executable on PATH, if exists. FIXME does not  respect setenv'd environment and uses findExecutable which uses the PATH inherited from the process  environment. b FIXME: findExecutable does not maintain a hash of existing commands and does a ton of file stats :%A monadic-conditional version of the when guard. ;%A monadic-conditional version of the unless guard. <4Does a path point to an existing filesystem object? ='Does a path point to an existing file? >KA 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 t ?9Remove 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. ACSet an environment variable. The environment is maintained in ShIO D internally, and is passed to any external commands to be executed. B,add the filepath onto the PATH env variable J FIXME: only effects the PATH once the process is ran, as per comments in 9 CCFetch the current value of an environment variable. Both empty and 7 non-existent variables give empty string as a result. DCFetch the current value of an environment variable. Both empty and ; non-existent variables give the default value as a result EDCreate a sub-ShIO in which external command outputs are not echoed.  Also commands are not printed.  See sub. F@Create a sub-ShIO in which external command outputs are echoed.  Executed commands are printed  See sub. GTurn on/off printing stdout HTurn on/off command echoing. I/Enter a sub-ShIO that inherits the environment B The original state will be restored when the sub-ShIO completes. % Exceptions are propagated normally. KIEnter a ShIO 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 ShIO. Msame as N, but returns () Nrun commands over SSH. - An ssh executable is expected in your path. " Commands are in the same form as O, but given as pairs  > sshPairs "server-name" [("cd", "dir"), ("rm",["-r","dir2"])] 7I am not fond of this interface, but it seems to work. Please note this sets J3 to False: the commands will not be shell escaped. 1 I think this should be more convenient for ssh. > Internally the list of commands are combined with the string  &&  before given to ssh. OGExecute an external command. Takes the command name (no shell allowed, 0 just a name of something that can be found via PATH; FIXME: setenv'd  PATH6 is not taken into account when finding the exe name) stdout and stderr are collected. The stdout is returned as  a result of run?, and complete stderr output is available after the fact using   lastStderr 4All of the stdout output will be loaded into memory : You can avoid this but still consume the result by using run_, I If you want to avoid the memory and need to process the output then use  runFoldLines. P&bind some arguments to run for re-use  Example: monit = command monit [-c, monitrc] Qbind some arguments to run_ for re-use  Example: monit_ = command_ monit [-c, monitrc] R=bind some arguments to run for re-use, and expect 1 argument  Example: git = command1 git []; git pull [origin, master] S=bind some arguments to run for re-use, and expect 1 argument  Example: git_ = command1_ git []; git+ pull [origin, master] U)The output of last external command. See run. V1set the stdin to be used and cleared by the next run. WLPipe operator. set the stdout the first command as the stdin of the second. X)Copy a file, or a directory recursively. YECopy a file. The second path could be a directory, in which case the 0 original file name is used, in that directory. ZCLike filter, but more conveniently used with String lists, where a < substring match (TODO: also provide globs) is expressed as  grep "needle" [ "the", "stack", "of", "hay" ] . Boolean  predicates just like with filter are supported too:  grep ("fun"  isPrefixOf) [...]. [(A functor-lifting function composition. \BCreate a temporary directory and pass it as a parameter to a ShIO 1 computation. The directory is nuked afterwards. ]Write a Lazy Text to a file. ^Append a Lazy Text to a file. _"(Strictly) read file into a Text. $ All other functions use Lazy Text. h So Internally this reads a file as strict text and then converts it to lazy text, which is inefficient `8Run a ShIO computation and collect timing information. S !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`uvwxyz{|}~[  !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`[KIEFJGHOT$WUVPQRSNMACDB/03)L2<= 9%& 1@?>YX78_]^\456[Z:;+,"#-.` !'( *P !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`uvwxyz{|}~   !"#$%&'()*++,,--./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnoppqrstuvwxyz{ |}~ shelly-0.11Shelly Shelly.Find Shelly.Base Filesystem stripPrefixbase Data.Functor<$> Control.Monadunlesswhentransformers-0.3.0.0Control.Monad.IO.ClassliftIOsystem-filepath-0.4.6Filesystem.Path.InternalFilePathShIOpath relativeTocanonic canonicalizeabsPathtest_dtest_sgettracels toTextIgnoreinspect inspect_errechoecho_necho_err echo_n_errcatchanyfindfindWhenfindFold findDirFilterfindDirFilterWhenfindFoldDirFilterTiming RunFailed ShellyHandlercmd<.> toTextWarnfromTexttagputcatch_sh finally_sh catches_sh catchany_shcdchdirmvlsTpwdexit errorExitterrormkdirmkdir_pwhichwhenMunlessMtest_etest_frm_rfrm_frmsetenv appendToPathgetenv getenv_defsilently verbosely print_stdoutprint_commandssubescapingshelly show_command sshPairs_sshPairsruncommandcommand_command1 command1_run_ lastStderrsetStdin-|-cp_rcpgrep<$$> withTmpDir writefile appendfilereadfiletimesStdin sPrintStdoutsPrintCommandsControl.Exception.BasecatchStatesCodesStderr sDirectorysRun sEnvironmentsTraceeitherRelativeTomaybeRelativeTounpackgetsmodify>=> text-0.11.2.2Data.Text.Lazy.InternalTextsystem-fileio-0.3.8 removeTree$fPredicateLike[][]$fPredicateLike(->)a$fShowReThrownException$fExceptionReThrownException$fExceptionRunFailed$fShowRunFailed$fToFilePath[]$fToFilePathText$fToFilePathText0$fToFilePathFilePath$fShellCommand(->)$fShellCommandReaderT$fShellCommandReaderT0$fShellCommandReaderT1$fShellArgFilePath$fShellArgText