Skip to content

Instantly share code, notes, and snippets.

@chrisdone-artificial
Last active May 6, 2022 11:15
Show Gist options
  • Save chrisdone-artificial/436b0fd1b11173eccf737d878ace184d to your computer and use it in GitHub Desktop.
Save chrisdone-artificial/436b0fd1b11173eccf737d878ace184d to your computer and use it in GitHub Desktop.
Hell notes

Reasons to do this

Docker 7e6569bbc29b brossa $ scripts/upload-product.sh localhost artificial/simple
scripts/upload-product.sh localhost artificial/simple
scripts/upload-product.sh: line 18: $3: unbound variable
#!/bin/hell
hell 2022-01-01:0
import Hell
import Git https://hell-shell.org/git@sha256:4bac27393bdd9777ce02453256c5577cd02275510b2227f473d03f533924f877
main = do
root <- Git.toplevel
let dir = root <> "/brossa/"
Hell.runDir dir "hpack" []?
Hell.runArgs dir "cabal" ["build"]
#!/bin/hell
hell 2022-01-01:0
-- must come before any other line apart from shebangs (if any)
-- must be exactly the major version
-- minor version of the binary is allowed to be newer than the one specified in file
-- must be imported explicitly, because it can be omitted too.
import Hell
import Git https://hell-shell.org/git@sha256:4bac27393bdd9777ce02453256c5577cd02275510b2227f473d03f533924f877
-- must be specified when there's a shebang
main = do
root <- Git.toplevel
let dir = root <> "/brossa/"
Hell.runDir dir "hpack" []?
Hell.runArgs dir "cabal" ["build"]
hell 2022-01-01:0
module Git (toplevel) where
import Hell
toplevel = readArgs "git" ["rev-parse", "--show-toplevel"]
-- modules are qualified by default, no implicit imports allowed!
-- local
import Foo.Bar
-- local, verified
import sha256:sdf87sdfn9sd87fsdfn Foo.Bar
-- remote
import https://foo.bar/bob Foo.Bar
-- remote, verified
import sha256:sdf87sdfn9sd87fsdfn https://foo.bar/bob Foo.Bar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment