File tree 2 files changed +38
-0
lines changed
2 files changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ module Example.CommandSubstitution (main ) where
2
+
3
+ import Prelude
4
+
5
+ import Data.Maybe (maybe )
6
+ import Dotenv (loadContents ) as Dotenv
7
+ import Effect (Effect )
8
+ import Effect.Aff (launchAff_ , throwError )
9
+ import Effect.Class (liftEffect )
10
+ import Effect.Console (log )
11
+ import Effect.Exception (error )
12
+ import Node.Process (lookupEnv )
13
+
14
+ main :: Effect Unit
15
+ main = launchAff_ do
16
+ Dotenv .loadContents " GREETING=Hello, $(whoami)!" -- Normally you'll use `loadFile` instead.
17
+ liftEffect do
18
+ greeting <- lookupEnv " GREETING"
19
+ maybe (throwError $ error $ " Couldn't find GREETING!" ) log greeting
Original file line number Diff line number Diff line change
1
+ module Example.VariableSubstitution (main ) where
2
+
3
+ import Prelude
4
+
5
+ import Data.Maybe (maybe )
6
+ import Dotenv (loadContents ) as Dotenv
7
+ import Effect (Effect )
8
+ import Effect.Aff (launchAff_ , throwError )
9
+ import Effect.Class (liftEffect )
10
+ import Effect.Console (log )
11
+ import Effect.Exception (error )
12
+ import Node.Process (lookupEnv )
13
+
14
+ main :: Effect Unit
15
+ main = launchAff_ do
16
+ Dotenv .loadContents " WHO=World\n GREETING=Hello, ${WHO}!" -- Normally you'll use `loadFile` instead.
17
+ liftEffect do
18
+ greeting <- lookupEnv " GREETING"
19
+ maybe (throwError $ error $ " Couldn't find GREETING!" ) log greeting
You can’t perform that action at this time.
0 commit comments