Commit ceef59f6 authored by Niels Bunkenburg's avatar Niels Bunkenburg

Adapt package directory structure #55 #56

parent c3fedda5
......@@ -47,11 +47,11 @@ getPackageDir :: String -> IO String
getPackageDir tmpdir = do
fulldir <- getDirectoryContents tmpdir
let dir = fulldir \\ [".",".."]
case dir of
[dirname] -> return $ tmpdir </> dirname
_ -> do
removeDirectory tmpdir
fail "Invalid package.tar.gz"
case elem "package.json" dir of
True -> return tmpdir
False -> do
removeDirectory tmpdir
fail"Invalid package.tar.gz"
handleUploadNewPackageTarGz :: UserID -> String -> IO ()
handleUploadNewPackageTarGz userid tarpath = do
......@@ -76,8 +76,6 @@ handleUploadNewPackageTarGz userid tarpath = do
removeDirectory tmpdir
ioError err
importMultiplePackages :: [String] -> IO ()
importMultiplePackages paths = do
-- untar all packages
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment