Safe Haskell | None |
---|
- link :: FilePath -> FilePath -> Script Actions ()
- register :: FilePath -> Script Actions ()
- copy :: FilePath -> FilePath -> Script Actions ()
- copyFile :: FilePath -> FilePath -> Script Actions ()
- copyDirectory :: FilePath -> FilePath -> Script Actions ()
- substitute :: FilePath -> FilePath -> Script Actions ()
- patch :: FilePath -> FilePath -> PatchSpec -> Script Actions ()
- raw :: FilePath -> [String] -> Script Actions ()
- profile :: String -> Script Sources a -> Script Sources a
- group :: String -> Script Sources a -> Script Sources a
- role :: String -> Script Sources a -> Script Sources a
- sudo :: User u -> Script s a -> Script s a
- retries :: Int -> Script s a -> Script s a
- reacting :: React -> Script s a -> Script s a
- prerequisiteOf :: Script Sources a -> Script Sources b -> Script Sources b
- (<~>) :: Script Sources a -> Script Sources b -> Script Sources b
Actions layer primitives
link :: FilePath -> FilePath -> Script Actions ()Source
Links given file to specified filepath
git "https://example.com/source.git" "git/source" $ link "some-file" "anywhere"
Links ~/git/source/some-file
to ~/anywhere
.
register :: FilePath -> Script Actions ()Source
Links source to specified filepath
git "https://example.com/source.git" "git/source" $ register "somewhere"
Links ~/git/source
to ~/somewhere
.
copy :: FilePath -> FilePath -> Script Actions ()Source
Copies file or directory to specified filepath
git "https://example.com/source.git" "git/source" $ copy "some-file" "anywhere"
Copies ~/git/source/some-file
to ~/anywhere
.
copyFile :: FilePath -> FilePath -> Script Actions ()Source
Copies only single file to specified filepath
git "https://example.com/source.git" "git/source" $ copy "some-file" "anywhere"
Copies ~/git/source/some-file
to ~/anywhere
.
copyDirectory :: FilePath -> FilePath -> Script Actions ()Source
Copies file or directory to specified filepath
git "https://example.com/source.git" "git/source" $ copy "some-file" "anywhere"
Copies ~/git/source/some-file
to ~/anywhere
.
substitute :: FilePath -> FilePath -> Script Actions ()Source
Substitutes templates in HStringTemplate
syntax
in given file and writes result to specified filepath
git "https://example.com/source.git" "git/source" $ substitute "some-file.template" "anywhere"
Copies ~/git/source/some-file.template
to ~/anywhere
.
Substitutes templates in ~/anywhere
with values from
templates
part of Controls
patch :: FilePath -> FilePath -> PatchSpec -> Script Actions ()Source
Applies the patch given the PatchSpec
git "https://example.com/source.git" "git/source" $ patch "some-patch.patch" "anywhere" (def { reversely = True })
Applies ~/git/source/some-patch.patch
to ~/anywhere
reversely.
raw :: FilePath -> [String] -> Script Actions ()Source
Monomorphised interface to sh
quasiquoter for
those who do not like -XTemplateHaskell
(or -XQuasiQuotes
)
git "https://example.com/source.git" "git/source" $ raw "/bin/echo" ["-n", "hello"]
Prints "hello" to stdout
Modifiers
profile :: String -> Script Sources a -> Script Sources aSource
Provides convenient Sources
grouping. May be nested
Information about sources and files related to a particular
profile profile
could be found in ~/.biegunka/profiles/
.
Example usage:
profile "dotfiles" $ do group "mine" $ git "https://github.com/supki/.dotfiles" ... group "not-mine" $ git "https://github.com/dmalikov/dotfiles" ... profile "experimental" $ do git "https://github.com/ekmett/lens" ...
group :: String -> Script Sources a -> Script Sources aSource
Alias for profile
. May be useful for nested grouping
role :: String -> Script Sources a -> Script Sources aSource
Alias for profile
. Everyone uses roles for something
reacting :: React -> Script s a -> Script s aSource
Change reaction pattern when retries are all failed