aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJoris2015-08-30 21:56:47 +0200
committerJoris2015-08-30 21:56:47 +0200
commit14670ab83231172f9f7bcb9f9ac0a11defe97c9a (patch)
tree9c6130345731c1c240373ff96c7c152e7fb8c258
parent779e58b150aacd2d4eb50a7ec761bb9454499b6f (diff)
Create output directory if missing
l---------perfume1
l---------run1
-rw-r--r--src/Main.hs4
3 files changed, 4 insertions, 2 deletions
diff --git a/perfume b/perfume
new file mode 120000
index 0000000..f5b7185
--- /dev/null
+++ b/perfume
@@ -0,0 +1 @@
+./dist/build/perfume/perfume \ No newline at end of file
diff --git a/run b/run
new file mode 120000
index 0000000..f5b7185
--- /dev/null
+++ b/run
@@ -0,0 +1 @@
+./dist/build/perfume/perfume \ No newline at end of file
diff --git a/src/Main.hs b/src/Main.hs
index f758ef7..f4fb50a 100644
--- a/src/Main.hs
+++ b/src/Main.hs
@@ -7,7 +7,7 @@ module Main
import HTTP
import System.Environment (getArgs, getProgName)
-import System.Directory (createDirectory)
+import System.Directory (createDirectoryIfMissing)
import Data.List (intercalate)
import Data.Text (Text)
@@ -39,7 +39,7 @@ main = do
outputDirectory = "output"
outputName = outputDirectory ++ "/" ++ (intercalate "-" materials) ++ ".csv"
in do
- createDirectory outputDirectory
+ createDirectoryIfMissing True outputDirectory
T.writeFile outputName (csvPerfumes commonPerfumes)
putStrLn ("Successfully generated " ++ outputName)