aboutsummaryrefslogtreecommitdiff
path: root/nodejs
diff options
context:
space:
mode:
authorIgor Pashev <pashev.igor@gmail.com>2017-10-10 16:11:34 +0300
committerIgor Pashev <pashev.igor@gmail.com>2017-10-10 16:23:13 +0300
commitc6239c19425b92724b09d7965e212a0ed856a609 (patch)
tree2185815c2b84744981fc6203408d9c17cd6e22c5 /nodejs
parent0e95d9d96e03d4fdc8d406235f1da8f9562241c8 (diff)
downloadzerobin-c6239c19425b92724b09d7965e212a0ed856a609.tar.gz
Use hindent
Diffstat (limited to 'nodejs')
-rw-r--r--nodejs/Main.hs25
1 files changed, 12 insertions, 13 deletions
diff --git a/nodejs/Main.hs b/nodejs/Main.hs
index 3cf74d9..48c67dd 100644
--- a/nodejs/Main.hs
+++ b/nodejs/Main.hs
@@ -1,18 +1,19 @@
{-# LANGUAGE OverloadedStrings #-}
-module Main where
+module Main
+ ( main
+ ) where
-import System.Environment (getArgs)
-import System.Process (callProcess)
-import Web.ZeroBin.SJCL (encrypt)
-import Web.ZeroBin.Utils (makePassword)
import qualified Data.Aeson as JSON
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as C
import qualified Data.ByteString.Lazy as L
+import System.Environment (getArgs)
+import System.Process (callProcess)
+import Web.ZeroBin.SJCL (encrypt)
+import Web.ZeroBin.Utils (makePassword)
-- nodejs is a Debian's thing, others may have simple "node"
-
getText :: IO BS.ByteString
getText = do
args <- map C.pack `fmap` getArgs
@@ -23,10 +24,8 @@ getText = do
main :: IO ()
main = do
password <- makePassword 32
- text <- getText
- cont <- encrypt password text
- callProcess "nodejs" [ "nodejs/decrypt.js"
- , password
- , C.unpack . L.toStrict $ JSON.encode cont
- ]
-
+ text <- getText
+ cont <- encrypt password text
+ callProcess
+ "nodejs"
+ ["nodejs/decrypt.js", password, C.unpack . L.toStrict $ JSON.encode cont]