Verified Commit cc143c16 authored by Camil Staps's avatar Camil Staps 🚀

Don't create package.json if it does not exist; this is too dangerous

parent 768c13c2
......@@ -149,18 +149,11 @@ where
maybeInstall w
# (exi,w) = fileExists electron w
| exi = w
# w = maybeCreatePackage w
# (exi,w) = fileExists "package.json" w
| not exi = abort "package.json does not exist\n"
# (_,w) = fclose (stderr <<< "electron binary not found; running npm install...\n") w
= justRunProcess "npm" ["install"] w
maybeCreatePackage :: !*World -> *World
maybeCreatePackage w
# (exi,w) = fileExists "package.json" w
| exi = w
# (_,w) = fclose (stderr <<< "package.json not found; creating...\n") w
# (_,w) = writeFile "package.json" "{\"devDependencies\":{\"electron\":\"^8.2.3\"}}" w
= w
justRunProcess :: !FilePath ![String] !*World -> *World
justRunProcess cmd args w
# (rcode,w) = callProcess cmd args Nothing w
......
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